Bash Scripting - Quoting and Expansion
Which of the following is the preferred syntax for command substitution in bash?
`command` or $(command). Both the backtick version and the incomplete $() version look valid at first.echo `ls -l` uses backticks which are valid but less readable and harder to nest. echo $(ls -l) uses $() which is modern and preferred. echo $[ls -l] uses invalid syntax with $[]. echo $(ls -l misses closing parenthesis.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions