[Question] Check File existence
Hi, I'm trying to write s simple script, that will check if a file exists and echo if found or not. Here is a piece of the script.
Code:
#!/bin/bash |
Well, if .tar.bz2 exists, it exits immediately... Maybe you should simply reorder your cases?
|
I think for this line,
Code:
if [ -e $1.tar.bz2 ] && [ -e $1.tar.bz2 ]; then Code:
if [ -e $1.tar.bz2 ] && [ -e $1.tar.gz ]; then |
Possibly you should use 'elif' instead of 'else if', and also take a look at 'case';
http://www.faqs.org/docs/bashman/bashref_20.html#SEC20 |
All times are GMT -5. The time now is 04:15 PM. |