Bash Scripting - Quoting and Expansion
What will be the output of this script snippet?
files=$(ls /tmp) echo "$files"
files=$(ls /tmp) echo "$files"
ls /tmp lists files in /tmp. Using files=$(ls /tmp) stores that output as a string with filenames separated by newlines.echo "$files" prints the content of files preserving newlines, so it lists all files and directories one per line.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions