Displaying 2 results from an estimated 2 matches for "ls_arg".
2019 May 16
2
bash off topic
I have a simple bash script it will take arguments from a file that has
quotes.
my file arg.txt would be this
-lt "*.txt"
my script file would be
LS_ARG=`cat arg.txt`
ls $LS_ARG
it does not run properly:
sh -x ./arg.sh
++ cat arg.txt
+ LS_ARG='-lt "*.txt"'
+ ls -lt '"*.txt"'
ls: cannot access "*.txt": No such file or directory
How do I resolve that ? If the quotes are not in my file it all works
fi...
2019 May 17
0
bash off topic
...gt;
> Cc:
> Bcc:
> Date: Thu, 16 May 2019 12:57:43 -0400
> Subject: [CentOS] bash off topic
> I have a simple bash script it will take arguments from a file that has
> quotes.
>
> my file arg.txt would be this
> -lt "*.txt"
>
> my script file would be
> LS_ARG=`cat arg.txt`
> ls $LS_ARG
>
> it does not run properly:
> sh -x ./arg.sh
> ++ cat arg.txt
> + LS_ARG='-lt "*.txt"'
> + ls -lt '"*.txt"'
> ls: cannot access "*.txt": No such file or directory
>
>
> How do I resolve that...