January 20th, 2014, 10:12 PM
Unable to unpack with bunzip2 using while loop
I have a problem with unzipping some file.xml.bz2 files to file.xml in while loop.
all other processing on files is successfull except bunzip2.
here is my piece of code
while read i
: No such file or directory.le file1.XML.ftpfail.bz2
: No such file or directory.le file2XML.ftpfail.bz2
: No such file or directory.le file3.XML.ftpfail.bz2
: No such file or directory.le file4.XML.ftpfail.bz2
file.lst contains the names of the file names.
" i " is detecting the file name correctly..
when i use bunzip2 filename as a single command it is working.. but in loop it is failing to detect the file and showing the error as above.
kindly suggest me with the what is the issue.
thank a lot in advance.
January 21st, 2014, 05:23 AM
The names of the files in the error message look a little 'strange' to me. Also the second file in the list of errors has no '.' before the XML part - not that that matters, so long as the name is correct!
If the use of bunzip2 in that loop is not working then, strictly, you will have an issue with the file name - are you sure there are no control characters in the file?
The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc
January 21st, 2014, 12:45 PM
As Simon says...It seems to be the file name.
Originally Posted by maroom
Use the ls command with -b or -q options to determine is there are non-printable characters in the file name.
PS: Post the contents of the "file.lst" file.