I actually re-wrote it and got it working.
Thanks for the suggested reading Mart, i'll definitely look those
over.
Thanks for all the help!
Thanks pk!
That's the same thin Greg told me.
#!/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 fu
Thanks Greg for the resource material! I'm making changes now
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
On 16.02.2010 19:52, Curtis wrote:
> Thanks pk!
>
> That's the same thin Greg told me.
>
> #!/bin/bash
>
>
> if [! -e b.txt];
if [[ ! -e b.txt ]; then ...; fi
or
if [[ ! - b.txt ]]
then
...
fi
you only need the semicolon if you omit the newline.
>
> then
>
> mv a.txt b.txt
>
> exit
>
>
Curtis wrote:
> if [! -e b.txt];
Please note that should literally be
if [ ! -e b.txt ];
NOT
if [! -e b.txt];
Try running the latter and you'll get errors.
Curtis wrote:
> Here's what I have but i'm getting some errors
>
> #!/bin/bash
>
>
> if ! (-e b.txt);
ITYM
if [ ! -e b.txt ]; then
...
On Feb 15, 3:20 pm, Mart Frauenlob wrote:
> > Original Message
> > Subject: About Bash Script
> > Date: Mon, 15 Feb 2010 10:39:25 -0600
> > From: Curt
> > To: mart.frauen...@chello.at
> > Hi Mart-
>
> > I saw you were helping another guy with a bash script
On Mon, Feb 15, 2010 at 10:20:05PM +0100, Mart Frauenlob wrote:
> > From: Curt
> > What I want to do is simply if the destination file exists, instead it
> > creates an index number and appends that to the name.
> >
> > If b.txt exists then a.txt will be renamed to b.txt.1, but if b.txt.1
> Original Message
> Subject: About Bash Script
> Date: Mon, 15 Feb 2010 10:39:25 -0600
> From: Curt
> To: mart.frauen...@chello.at
> Hi Mart-
>
> I saw you were helping another guy with a bash scripthopefully you'll
> remember but i'm trying to modif
10 matches
Mail list logo