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

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -