Skip to content
Advertisement

Tag: nested-loops

Nested bash loop runs but logic is not correct

I have this nested bash for loop where the first loop represents the range of servers, and the second loop reads each lines of the .txt file. Then will do a zgrep -i and find for a string on the matching line. keys.txt is as follow: Bash Loops: This runs but its logging every instance where ‘InitialRequest’ is defined. What

rename files which produced by split

I splitted the huge file and output is several files which start by x character. I want to rename them and make a list which sorted by name like below: part-1.gz part-2.gz part-3.gz … I tried below CMD: for (( i = 1; i <= 3; i++ )) ;do for f in `ls -l | awk ‘{print $9}’ | grep

Advertisement