Viewing 1 to 8 of 8 items
Tag Archives: Syntax

Unix Shell Script Syntax for if and grep and -gt

There are two errors in your script: Nested backticks are not allowed. $2/$file_z instead of $(<$2/$file_z) Fixed: for j in `<$2/$file_z` do if grep -q “$1” “$j” > /dev/null # if grep “$1” “$j” > /dev/null # if your grep does not support -q then echo $j cp $j $3 fi done More optimal: for j in `<$2/$file_z` do  Full Article…

0

checkprocess.sh – Check process & restart

I have a process that has been crashing every few days, but needs to be running 24/7 to be effective. Until I find the time to seek out the cause, I need the process to be restarted. This short SH script uses PS to check that the process is running, and if not, runs the  Full Article…

0

.sh file syntax checking script

This isn’t a question–its a solution! Below is a script that I wrote for my own script file development which does what the title says. Its the closest that you can get to compiling what are otherwise purely interpreted script files. I offer it here simply for the benefit of anyone else writing script files.  Full Article…

0