Relative Content

Tag Archive for bashshell

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.

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