Question
In linux, in bash scripting, you can use the "for in" loop to loop over files, without using the $(ls) command expansion. For example rewrite the following without using$(ls) command expansion:
for file in $(ls *.txt); do echo "found another text file!" done Answer for file in *.txt; do echo "found another text file!" done Question In linux, in bash scripting, you can use the "for in" loop to loop over files, without using the$(ls) command expansion. For example rewrite the following without using $(ls) command expansion: for file in$(ls *.txt); do
echo "found another text file!"
done
?

Question
In linux, in bash scripting, you can use the "for in" loop to loop over files, without using the $(ls) command expansion. For example rewrite the following without using$(ls) command expansion:
for file in $(ls *.txt); do echo "found another text file!" done Answer for file in *.txt; do echo "found another text file!" done If you want to change selection, open document below and click on "Move attachment" 7. Shell Scripting the shell can expand file names when given wildcards. For instance, we can type ls *.txt to list all files ending with .txt . This applies equally well in any situation, for instance: #!/bin/sh <span>for i in *.txt ; do echo "found a file:"$i done The *.txt is expanded to all matching files. These files are searched for in the current directory. If you include an absolute path then the shell will search in that directory: #!/bin/

#### Summary

status measured difficulty not learned 37% [default] 0

No repetitions