≡ Menu

bash for

Bash For Loop Spaces

How do I use bash for loop with spaces in a file name on Unix or Linux operating system? The following code fails with errors:

files=$(ls *.txt)
for f in $files
cp "$f" $dest

How do I fix this problem on bash shell?
[click to continue…]

Sysadmin because even developers need heroes!!!

Linux bash for loop

Q. How do I use bash for loop under Linux operating systems?
[click to continue…]