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:

TaxTotal Problem (1997) [WebDNA] Repeated Task [reworking a DB) (2015) Join us at MacWorld! - Part 2 (1998) Windows Serial (2005) Date problems (1997) WebCat & WebTen (1997) Only charge card when product shipped ? (1997) [WebDNA] listvariables (2014) UPPERCASE (1997) Errata: WCS Newbie question (1997) minimalist shopping cart. (1997) Webmessage Hyperboard (1998) Changing to a windows mounted share from a Mac OS X machine (2002) (long) Support (was wo search help) (1999) WCS Newbie question (1997) Pithy questions on webcommerce & siteedit (1997) quantity minimum problem (1997) Socks Proxy Error (1999) Server Traffic Simulation (1998) Support ?? (1997)