whitespace - Simple bash script to read from one file having double quotes in content -
OK, I'm really worried :( I have a file named test.txt and here's this:
"/ var / lib / backup.log" "/var/lib/backup2.log"
Double quotes file contains the beginning and end of each Directory and I can not delete them.
I am trying to write a script to extract the files in test.txt. By this way:
del Test .txt`; rm -f $ del done
but it does not work as expected Does it: (
It returns this error:
rm: "/var/lib/backup.log" can not be used: such a File or directory can not access RM: "/var/lib/backup.log2": Any such file or directory
This will only remove the quotation character from the beginning and the end of the interval, which is better than indiscriminately removing all the quotation characters (because they can appear in filenames, of course ).
And, with regard to your ITAL code, unless you really do not know when and when not. Do fname = $ {REPLY # \ "} fname = $ {fname% \"} Echo RM-F did "$ fname" & lt; Myfiles.txt
Comments
Post a Comment