Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In linux, write simple bash script that goes through and prints name of all files in current directory (to show your knowledge of for loop).
Answer
#!/bin/bash

for file in $(ls)
do
    echo $file
done
[default - edit me]

Question
In linux, write simple bash script that goes through and prints name of all files in current directory (to show your knowledge of for loop).
Answer
?

Question
In linux, write simple bash script that goes through and prints name of all files in current directory (to show your knowledge of for loop).
Answer
#!/bin/bash

for file in $(ls)
do
    echo $file
done
[default - edit me]
If you want to change selection, open document below and click on "Move attachment"

7. Shell Scripting
est "$N" -gt "10"; do echo "Number $N"; N=$[N+1] ; done 7.3 Looping to Repeat Commands: the for Statement The for command also allows execution of commands multiple times. It works like this: 5 <span>for i in cows sheep chickens pigs do echo "$i is a farm animal" done echo -e "but\nGNUs are not farm animals" The for command takes each string after the in , and executes the lines between

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.