[SLE] Re: Testing using Bash for an unknown extension
From: Sean Rima (sean_at_tcob1.net)
Date: 11/30/03
- Previous message: Sean Rima: "[SLE] Re: defrag for linux-answered at TLDP"
- In reply to: Jerry Feldman: "Re: [SLE] Testing using Bash for an unknown extension"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: suse-linux-e@suse.com Date: Sun, 30 Nov 2003 16:02:18 +0000
Jerry Feldman 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?
> You might be a bit better off using the for command.
> #!/bin/bash
> if [ -e /var/max/spool/inbound/ab251455.* ] ; then
> LIST=$(ls /var/max/spool/inbound/ab251455.*)
> for i in $LIST
> do
> runcommand $i
> done
> fi
> - ----------------
> This will allow you to issue your command on the individual file.
>
I cannot get it to work if there is a path in the test line otherwise this
is perfect for something I need to do :)
Sean
- application/pgp-signature attachment: stored
- Previous message: Sean Rima: "[SLE] Re: defrag for linux-answered at TLDP"
- In reply to: Jerry Feldman: "Re: [SLE] Testing using Bash for an unknown extension"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|