Search Results

Search: Posts Made By: the_gripmaster
1,755
Posted By the_gripmaster
Cool. Thanks.
Cool. Thanks.
1,755
Posted By the_gripmaster
Is there a way to shorten snippet 2?
Is there a way to shorten snippet 2?
1,755
Posted By the_gripmaster
Bash conditional | getting logic wrong?
I have a file


cat <<EOF > /tmp/test
Line one
Line two
Line three
EOF


Now I am trying to get the exit stat ($?) of 1 if any text is found and 0 if any text is not found using grep, i.e....
4,972
Posted By the_gripmaster
What are you trying to run? Paste the contents...
What are you trying to run? Paste the contents here.

You can make a script run continuously by placing it in a continuous while or for loop and using the nohup command to run it.


while true;...
1,007
Posted By the_gripmaster
You can write a bash script with the diff command...
You can write a bash script with the diff command but I think an easier way is to use rsync


rsync --dry-run -avc dir1/ dir2/


--dry-run with make sure files are not rsynced.
1,217
Posted By the_gripmaster
Just wanted to point out a gotcha here: even a...
Just wanted to point out a gotcha here: even a single extra blank line or a space will produce dissimilar cksums. Otherwise this is okay to find similar files.
1,874
Posted By the_gripmaster
Ok, I am wrong.
Ok, I am wrong.
1,173
Posted By the_gripmaster
Try grep -v -E '^[0-9]+ [0-9]+' filename ...
Try


grep -v -E '^[0-9]+ [0-9]+' filename


or


grep -E '^[0-9]+$' filename
1,874
Posted By the_gripmaster
I am running Bash 4.x and find (find (GNU...
I am running Bash 4.x and find (find (GNU findutils) 4.4.2) does return exit code of 1 when the file is not found.

---------- Post updated at 09:10 PM ---------- Previous update was at 09:09 PM...
1,874
Posted By the_gripmaster
find *.doc -mtime -1 -ls > test.log if [ $?...
find *.doc -mtime -1 -ls > test.log

if [ $? -ne 0 ]; then
echo "Server password expires" >> test.log
fi
2,841
Posted By the_gripmaster
I am a bit confused with the code. elif instead...
I am a bit confused with the code. elif instead of if in the ending section?


DATA=/11/store/data/

if [ "$2" = "A1" ]; then
FINALPATH=$DATA/Run2012A/DoubleElectron/AOD/PromptReco-v1
elif [...
2,841
Posted By the_gripmaster
grep -E '^[0-9]+' ? finds the line...
grep -E '^[0-9]+' ?

finds the line starting(^) with any digit ([0-9])

Did my previous command serve your purpose? Outputs like 222,22-33,44,..... in one line.
1,733
Posted By the_gripmaster
-iname does a case insensitive match. So, rOOt,...
-iname does a case insensitive match. So, rOOt, ROOT, Root...will all be matched

The man find from the terminal will give you all the options.
1,733
Posted By the_gripmaster
A slight improvement find /path -name...
A slight improvement


find /path -name "*.root"
2,841
Posted By the_gripmaster
I could explain but the sed is very difficult to...
I could explain but the sed is very difficult to explain. You need to learn regular expressions if you don't know that already to understand the sed commands.

I guess this command will give you...
1,733
Posted By the_gripmaster
find /path -iname "*root"
find /path -iname "*root"
2,841
Posted By the_gripmaster
-A 2 tell grep to get the +2 line from the string...
-A 2 tell grep to get the +2 line from the string "Jobs Aborted" because that is the line containing the numbers.

grep -A 2 "Jobs Aborted" file | sed 's/.*: //;s/,/\n/g' | while read job; do
...
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 07:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy