Patrick Shanahan writes:
I am trying to test to see if a file exsides but the extension changes all the time, ie
ab251455.001 ab251455.002
if I do a : if [ -e /var/max/spool/inbound/ab251455.* ] ; then run_command fi
the run_command never runs
That's strange. I tried with #!/bin/bash if [ -e ab123.* ] ; then echo "It exists" fi and it works perfectly. Is run_command in the path?
It is, but I noticed that you didn't include a path, maybe that is why mine is failing, will experiment.
Then you will have to start the script in the directory that the subject file resides.
Have you checked to see if you have read/write access (permission) for the directory where ab251455.00? resides?
You might also substitute 'echo "It exists"' for 'run_command' to try to isolate the problem to 'run_command' or '[ -e .... ]'.
I will try these as well as cd'ing to the directory that the files are in first. Sean