Bash: using cat within for loop -


the following cat command seems work fine outside loop when place inside of gives syntax error:

for in 1 2 3 4 5   cat file_$i | grep "random text" | cut -d':' -f2 > temp_$i done 

could explain me correct way write this? thank you

your for loop should have semicolon:

for in 1 2 3 4 5; 

Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

android - MPAndroidChart - How to add Annotations or images to the chart -