Hi, Read more →. En gros ce "combo" permet en général de parcourir un fichier. $read var1 coucou $echo $var1 coucou $ Tous les mots saisis sont stockés dans la variables var1 $read var1 coucou tout le monde $echo $var1 coucou tout le monde $ Le premier mot est stocké dans var1 et le second dans var2 $ read var1 var2 A bientot $echo $var1 A $ echo $var2 bientot $ Le premier mot est stocké dans var1 et les autres dans var2 $ read var1 var2 A bientot tout le monde $ echo $var1 A $ echo $var2 bientot tout le monde $ Le mot est stocké dans var1 et var2 est vide $read var1 var2 Bonjour $ec… Pour passer outre, 2 solutions (en tout cas, j'en connais 2, il y en a peut-être d'autres) : 1. Add more (space-separated) elements to the right of the in keyword. And it is, and Unix has the seq utility for this: Many repetitive tasks aren't as simple as counting from x to y, and so the problem becomes how to generate a non-linear list of items? For longer files, I'll work on my computer's text editor (Sublime Text) and then upload to the server. bash - variable - while read line ksh . What might such as a task be? Once you're reasonably confident that no minor syntax errors are tripping you up, then it's time to think about how to find a general pattern for the 9,997 other URLs. When writing a bash script, depends on the automation flow sometimes the script has to read the content from the file line by line. echo “line contains somestring” So maybe it's a variable? However, if you're new to programming in any language, what might also be unclear is how working with data streams is different than working with loops. Cool Tip: Make your Bash script interactive! I knew there was a way to do it without programming it. The syntax is as follows for bash, ksh, zsh, and all other shells to read a file line by line; while read -r line; do COMMAND; done ; The -r option passed to read command prevents backslash escapes from being interpreted. So the loop doesn't automatically do anything specific to the collection of values we gave it. The general while read line construction that can be used in Bash scripts: The same construction in one line (easy to use on the Linux command line): As example lets print all users from the /etc/passwd file: You can change it to the more appropriate name, depending on the contents of a FILE. Take this variation of the read-while loop, in which the result of echo | grep is piped, line by line, into the while loop, which prints to stdout using echo, which is redirected to the file named some.txt: This is not a construct that you may need to do often, if at all, but hopefully it reinforces pipe usage in Unix. Example – Using While Loop. The output: