Skip to main content

All Questions

-2 votes
1 answer
67 views

regular single column data to multiple rows

source data KKK-SNMImsi: 444444 KKK-SNMUserProfileId: KKK-SNMDefaultAutomaticProfile KKK-SNMMmeAddress: TDSGSN01 KKK-SNMMsisdn: 44235682436 KKK-SNMLocationState: LOCATED KKK-SNMRoamingAllowed: FALSE ...
Peter Cherop's user avatar
0 votes
0 answers
116 views

Bash script or the like to erase env values that host secrets once used to initialized app in a kubernetes container

I have a flask app that runs in a kube cluster. It does all the right things by using kube secrets to set the env values required to initialize the application. There are some env values I suspect ...
Edmund's Echo's user avatar
0 votes
2 answers
44 views

How to add the strings in a particular line without hardcoding

I have 2 files, 1st file it has the output and another one template. I want to add ID's in the template from output without hardcode the value. Output.txt, abc 8392382222 def 9283923829 ...
Beginner's user avatar
  • 1,990
0 votes
0 answers
307 views

systemd doesn't read environment variables required for script

I want to use borg backup and systemd timers to do my backups. I am using the script from borg backup website very slightly adjusted. You can see the original HERE and my script below: #!/bin/sh # ...
callmebob's user avatar
  • 101
0 votes
1 answer
4k views

Run bash script in cronjob

i'm trying to automate a script using crontab. I've been searching for some information to help me, but haven't been successful so far. I created the script with the shebang and full paths. #!/bin/...
Matzi's user avatar
  • 3
0 votes
3 answers
161 views

How to copy all files with same extension between identical directory structures?

I have 2 independent folders A and B. B has many files with the extension .build. Across A there are a fe subdirectories that have the same structure as subdirectories of B. For example A has ...
Makogan's user avatar
  • 113
0 votes
2 answers
820 views

Getting error when calling shell script ONLY with "sh -c" : "unexpected operator"

I have the following script: installRequiredFiles=$1 install_with_pkg() { arg1=$1 echo $arg1 echo "[+] Running update: $arg1 update." } if [ $installRequiredFiles = "...
E235's user avatar
  • 383
1 vote
1 answer
5k views

How to create a shell script with the systemctl

I've been trying to create a script but it doesn't work out, if you can help me ... I'm doing a script on the systemctl command that should ask you to write the name of a service, and then show you ...
Jonas's user avatar
  • 21
1 vote
2 answers
2k views

How to kill python process ran by shell script when shell script dies?

I have a shell script that runs python. start.sh # Setup environment cd ~/foobar/ && \ python3 -m venv env && \ source env/bin/activate && \ pip install -q -r ...
ACD's user avatar
  • 111
0 votes
3 answers
724 views

find doesn't work when run from remote script

I have following line in a script: find ~ Templates -maxdepth 0 -type d -empty which works fine, as expected. However when I copy my script to samba share and run it from there (bash myscript.sh), ...
mauek unak's user avatar
3 votes
3 answers
4k views

Read text file and move only those files to another folder

I have a folder filled with 100 log files, some of them have data, some dont. I have a script that picks out the files with the data and have the names saved in a text file named "goodfiles.txt" I ...
Vineeth Thomas's user avatar
-2 votes
1 answer
99 views

Ubuntu - View data Lines 10 by 10 [closed]

I need to write a script to view /etc/passwd 10 by 10 with pages numbers under. So it will display the next 10 lines after pressing a button. What command should I use? Have tried to check awk, head,...
user355270's user avatar
-1 votes
1 answer
412 views

Bash script, error "Arg list too long"

I need to run a bash script in a .lua file: os.execute ("/path/to/file.sh") file.sh: #!/bin/bash route add 149.36.98.78 reject The permissions for file.sh is [-rwxr-x---] root www-data I'm ...
mario's user avatar
  • 103
15 votes
6 answers
6k views

Is it correct to use /bin/sh in the hashbang if the Bourne shell isn't available in a distribution?

Generally, shell scripts contain the following comment at the first line of the script file: #!/bin/sh. According to the researches that I made, this is called "hash bang" and it is conventional ...
Goktug's user avatar
  • 611
3 votes
2 answers
2k views

Copy a folder overwriting ONLY smaller files in destination

I have tons of PDFs in multiple sub-folders in /home/user/original that I have compressed using ghostscript pdfwrite in /home/user/compressed. ghostscript has done a great job at compressing about 90% ...
Umer's user avatar
  • 157

15 30 50 per page