repeat bash command until output does not contain a given string
I often need to run different commands that would need to be re-run immediately after if the output contains a given string (status code is not enough).
Shell script installation
I wrote a shell script, and I’m trying to automate it’s installation. For that, I have a script that 1.) downloads the script to ~/.local/bin
2.) adds a line to .bashrc
(or config.fish
, etc.). The line for .bashrc
looks like eval "$(myscript init bash)"
.
Not getting the desired result in the shell script
I am trying to search a particular pattern “JOB” in all the files in the mentioned directories, and the checking if the next word after JOB has atleast 5 characters and if the 5th character is “H” or “I” in the next word, and then trying to print the file name, pattern and the next word in a file. but it is only printing the directory name in the output file.
bash error message seemingly comes from environment instead of from bash itself when executing inside a function
Consider the following simple bash script
Bash: How to continue for loop when condition X is satisfied
I’m trying to start a process on multiple VMs using GitHub Actions. However, the command doesn’t complete (as it needs to continue running) so my for loop just kind of hangs.
create a variable using a value of another variable and store value into the newly created variable in shell/bash script
I am trying to create a Variable from value of another variable and trying to store value into the created variable in Shell Script. For Example:
Let there is a existing variable i=1
scp and mv to copy file to a server and a folder in multiple sessions
I am having an issue with missing files while copying and moving them. To give a bit of background,
How to write script when not allowed to use backticks, &&, || or ;
Write a bash script that changes the owner of the file hello to betty only if it is owned by the user guillaume.
BASH conditional unexpected end of file error with conditional with OR
Getting the following error : syntax error: unexpected end of file
AWK command to find the 1 hour aged files and print file names
I want to print the file names from a directory that are 1 hour old from current time using AWK command, file name starts with ‘file’.
i have a command like this already . i want to use AWK command to print the file names .
$find /tmp/test/ -mmin +60
i have files like below,
-rw-r–r– 1 TENT Tinstall 0 Jun 3 10:20 file1.txt
-rw-r–r– 1 TENT Tinstall 0 Jun 3 10:20 file2.txt
-rw-r–r– 1 TENT Tinstall 0 Jun 3 10:23 file3.txt