[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FWD: About Bash Script
From: |
Curtis |
Subject: |
Re: FWD: About Bash Script |
Date: |
Tue, 16 Feb 2010 07:57:07 -0800 (PST) |
User-agent: |
G2/1.0 |
Here's what I have but i'm getting some errors
#!/bin/bash
if ! (-e b.txt);
then
mv a.txt b.txt
exit
fi
#The previous commands checks to see if b.txt is NOT already there, if
NOT, it renames a.txt to b.txt
#If the script gets here, b.txt EXISTS..........
# does_exist is a recursive function....looking at b.txt(i) ......the
first b.txt(some number) it finds NOT existing...it creates....
set i = 1
does_exist()
{
if (-e b.txt.$1);
then
i = i +1
does_exist
else
mv a.txt b.txt.$i
exit
fi
}
- FWD: About Bash Script, Mart Frauenlob, 2010/02/15
- Re: FWD: About Bash Script, Greg Wooledge, 2010/02/15
- Re: FWD: About Bash Script, Curtis, 2010/02/15
- Message not available
- Re: FWD: About Bash Script,
Curtis <=
- Re: FWD: About Bash Script, pk, 2010/02/16
- Re: FWD: About Bash Script, Curtis, 2010/02/16
- Re: FWD: About Bash Script, Curtis, 2010/02/16
- Re: FWD: About Bash Script, pk, 2010/02/16
- Re: FWD: About Bash Script, Mart Frauenlob, 2010/02/16
- Re: FWD: About Bash Script, Curtis, 2010/02/16