I have the follow files in my folder:
a.jpg b.jpg c.jpg
And I have the follow script:
#!/bin/bash
echo $1
If I run:
script.sh $(ls)
My output is:
a.jpg
But I want to be:
a.jpg b.jpg c.jpg
So, Why doesn't echo prints all the output from ls?
script.sh "$(ls)", notscript.sh $(ls)? (2) Is this an exercise just to see how Bash behaves? If not then just runlsbecause what you're doing is unnecessarily complicated. – Kamil Maciorowski Aug 09 '23 at 14:59$1with$@? – Cyrus Aug 09 '23 at 23:10