Re: FWD: About Bash Script

2010-02-16 Thread Curtis
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!

Re: FWD: About Bash Script

2010-02-16 Thread Curtis
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

Re: FWD: About Bash Script

2010-02-16 Thread Curtis
Thanks Greg for the resource material! I'm making changes now

Re: FWD: About Bash Script

2010-02-16 Thread Curtis
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

Re: FWD: About Bash Script

2010-02-16 Thread Mart Frauenlob
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 > >

Re: FWD: About Bash Script

2010-02-16 Thread pk
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.

Re: FWD: About Bash Script

2010-02-16 Thread pk
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 ...

Re: FWD: About Bash Script

2010-02-15 Thread Curtis
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

Re: FWD: About Bash Script

2010-02-15 Thread Greg Wooledge
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

FWD: About Bash Script

2010-02-15 Thread Mart Frauenlob
> 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