Re: [OT] Shell script

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 60244
interpreted = N
texte = Hi there This has gotten me on the right track but still I am stuck. I nee= d to but the "final" name without the .txt extension in a variabl= e. So far I have tried everything but can't get any further. Any=20= clue? thistest=3D`ls *.text | awk '{print("mv "$1" "$1)}' | sed 's/.txt= //2'` echo $thistest Thank you. Nitai -- Redakto - Content Management that simply works Content Management & eBusiness Systems ComputerOil=C2=AE AG Dammstrasse 7 5400 Baden / Switzerland Telefon +41 (0)844 44 55 66 info@computeroil.com http://computeroil.com > -----Original Message----- > From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On B= ehalf Of > Erol Guneri > Sent: Dienstag, 30. November 2004 13:48 > To: WebDNA Talk > Subject: Re: [OT] Shell script > > Hi Nitai, > > Try this: > > ls *.txt | awk '{print("mv "$1" "$1)}' | sed 's/.txt//2' > > This will output a list of move commands onto the screen (to ch= eck it > first). If it looks fine, just add | /bin/sh to the end to mak= e it > execute. > > Erol > > > > ----- Original Message ----- > From: "Nitai @ ComputerOil" > To: "WebDNA Talk" > Sent: Tuesday, November 30, 2004 12:30 PM > Subject: [OT] Shell script > > > > Hi all > > > > I know off topic, but maybe someone knows an answer: > > > > I need to substract some text from a variable within a shell=20= script and > cant get it to work. Some code here: > > > > $file =3D myfile.txt > > > > And I need: > > > > $file =3D myfile > > > > Since $file can hold variable filenames I need to get somethi= ng that > just > substract the .txt on each file, so that I just remove the .txt= .. > > > > I have tried to get something like this going: > > > > $file =3D substr($file,.txt) > > Or > > $file =3D sub(?,?,?) > > > > Maybe someone can shed some light? TIA. > > > > Nitai > > > > -- > > Redakto - Content Management that simply works > > Content Management & eBusiness Systems > > > > ComputerOil=C2=AE AG > > Dammstrasse 7 > > 5400 Baden / Switzerland > > Telefon +41 (0)844 44 55 66 > > > > info@computeroil.com > > http://computeroil.com > > > > > > > > > > -------------------------------------------------------------= > > This message is sent to you because you are subscribed to > > the mailing list . > > To unsubscribe, E-mail to: > > To switch to the DIGEST mode, E-mail to > > > Web Archive of this list is at: http://webdna.smithmicro.com/= > > > > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: [OT] Shell script ( "Nitai @ ComputerOil" 2004)
  2. Re: [OT] Shell script ( "Kaiwi, Marc" 2004)
  3. Re: [OT] Shell script ( "Nitai @ ComputerOil" 2004)
  4. Re: [OT] Shell script ( "Erol Guneri" 2004)
  5. [OT] Shell script ( "Nitai @ ComputerOil" 2004)
Hi there This has gotten me on the right track but still I am stuck. I nee= d to but the "final" name without the .txt extension in a variabl= e. So far I have tried everything but can't get any further. Any=20= clue? thistest=3D`ls *.text | awk '{print("mv "$1" "$1)}' | sed 's/.txt= //2'` echo $thistest Thank you. Nitai -- Redakto - Content Management that simply works Content Management & eBusiness Systems ComputerOil=C2=AE AG Dammstrasse 7 5400 Baden / Switzerland Telefon +41 (0)844 44 55 66 info@computeroil.com http://computeroil.com > -----Original Message----- > From: WebDNA Talk [mailto:WebDNA-Talk@talk.smithmicro.com] On B= ehalf Of > Erol Guneri > Sent: Dienstag, 30. November 2004 13:48 > To: WebDNA Talk > Subject: Re: [OT] Shell script > > Hi Nitai, > > Try this: > > ls *.txt | awk '{print("mv "$1" "$1)}' | sed 's/.txt//2' > > This will output a list of move commands onto the screen (to ch= eck it > first). If it looks fine, just add | /bin/sh to the end to mak= e it > execute. > > Erol > > > > ----- Original Message ----- > From: "Nitai @ ComputerOil" > To: "WebDNA Talk" > Sent: Tuesday, November 30, 2004 12:30 PM > Subject: [OT] Shell script > > > > Hi all > > > > I know off topic, but maybe someone knows an answer: > > > > I need to substract some text from a variable within a shell=20= script and > cant get it to work. Some code here: > > > > $file =3D myfile.txt > > > > And I need: > > > > $file =3D myfile > > > > Since $file can hold variable filenames I need to get somethi= ng that > just > substract the .txt on each file, so that I just remove the .txt= .. > > > > I have tried to get something like this going: > > > > $file =3D substr($file,.txt) > > Or > > $file =3D sub(?,?,?) > > > > Maybe someone can shed some light? TIA. > > > > Nitai > > > > -- > > Redakto - Content Management that simply works > > Content Management & eBusiness Systems > > > > ComputerOil=C2=AE AG > > Dammstrasse 7 > > 5400 Baden / Switzerland > > Telefon +41 (0)844 44 55 66 > > > > info@computeroil.com > > http://computeroil.com > > > > > > > > > > -------------------------------------------------------------= > > This message is sent to you because you are subscribed to > > the mailing list . > > To unsubscribe, E-mail to: > > To switch to the DIGEST mode, E-mail to > > > Web Archive of this list is at: http://webdna.smithmicro.com/= > > > > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ "Nitai @ ComputerOil"

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Banners (1997) WebDNA FAQ or FAQs -- was "weird problem" (2004) Decrypt Users.db (2005) SQL, ODBC and MySql (2002) Sendmail doesn't (was Queertrons?) (1997) Stopping bad HTML propagation ? (1997) [writefile] (1997) Comments Please ... Omnis Studio v WC (2001) Help! WebCat2 bug (Ben's input) (1997) Search returns all, not 20 (1997) Webstar 1.3.1 PPC (1997) unable to launch acgi in WebCat (1997) Another bug to squash (WebCat2b13 Mac .acgi) (1997) Smith Micro - no competition (2000) Trouble with formula.db (1997) Just Testing (1997) Commitdatabase tag (1998) Country & Ship-to address & other fields ? (1997) Searching multiple fields from one form field (1997) Sku numbers (1997)