I have several bash script which contain in them infinite while loop. I would like to run all of them from a single script: what I get is that it stuck on the first script and it does not proceed to the next one to run them simultaneous. Answer Notice the & symble at the end of each line, that
Tag: bash
Running script in crontab–reboot: command not found
I’ve set a script in my root crontab that is supposed to restart my machine with the reboot command. However, I am getting a reboot: command not found despite the fact that reboot is in the root user’s path. My script: root user crontab: …yes, this is only a temporary workaround while I figu…
Collect and sum statistics of `strace` commands?
I know that I can runstrace -c ls to collect system call statistics on the ls executable. However, I want to run the command strace -c {some executable here} mulitiple times over different executables, merge the individual results, and then write to a single file. I want to merge the ‘syscall’ and…
sudo doesn’t work, but root user works [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
“usermod: UID ‘0’ already exists” why?
As part of my Docker image I have the following ENTRYPOINT script: The image compiles successfully. When I try to run the container by running the following command docker run -it temp bash I got the following output: Why my UID is 0? I can’t find where is my error here, any help is more than welcome. U…
Bash ‘swallowing’ sub-shell children process when executing a single command
Bumped into an unexpected bash/sh behavior and I wonder someone can explain the rationale behind it, and provide a solution to the question below. In an interactive bash shell session, I execute: $ bash -c ‘sleep 10 && echo’ With ps on Linux it looks like this: _ -bash _ bash -c sleep 10 &…
How to rename file name contains backslash in bash?
I got a tar file, after extracting, there are many files naming like I want to correct their name into files in sub-directories like I face a problem when a variable contains backslash, it will change the original file name. I want to write a script to rename them. Answer Parameter expansion is the way to go.…
Copying files from multiple directories into a single destination directory
There are multiple directories which contain a file with the same name: Now I want to extract them to another directory, direct_new and with a different file name such as: How can I do this? BTW, if I want to put part of the name in original directory into the file name such as: What can I do? Answer This
How to exclude print commands of python script in variable of shell script
I have a python script called spark.py. This scipt will be invoked using a shell script in Linux. The spark.py is like below: The shell.sh is like below In this shell script I am collecting the output of the spark.py as a variable. When I do so I am unable to see any print commands of the spark.py in the
Automatically close PuTTY when connection is lost
I have a script in bash, running multiple PuTTY sessions. For example, I open the connection to run a couple of commands, when it finishes it saves the values, closes the session, opens a new session and runs a couple more. This script is supposed to run for 60 hours, more or less, so i need to have everythin…