Re: [OT] Shell script

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 60239
interpreted = N
texte = 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 check it first). If it looks fine, just add | /bin/sh to the end to make 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 script and cant get it to work. Some code here: > > $file = myfile.txt > > And I need: > > $file = myfile > > Since $file can hold variable filenames I need to get something 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 = substr($file,.txt) > Or > $file = sub(?,?,?) > > Maybe someone can shed some light? TIA. > > Nitai > > -- > Redakto - Content Management that simply works > Content Management & eBusiness Systems > > ComputerOil® 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 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 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 check it first). If it looks fine, just add | /bin/sh to the end to make 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 script and cant get it to work. Some code here: > > $file = myfile.txt > > And I need: > > $file = myfile > > Since $file can hold variable filenames I need to get something 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 = substr($file,.txt) > Or > $file = sub(?,?,?) > > Maybe someone can shed some light? TIA. > > Nitai > > -- > Redakto - Content Management that simply works > Content Management & eBusiness Systems > > ComputerOil® 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 Web Archive of this list is at: http://webdna.smithmicro.com/ "Erol Guneri"

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:

Web Logs (1998) off topic - dna snipets (1997) two of the same named db's open at once (1998) 2.1b3 --> way slow (1997) Emailer [cart] file names (1997) Forms Search Questions (1997) Limiting user access to .tmpl files (1997) Order not created error (never mind) (1997) Virtual Postcards (1998) [WebDNA] a major shift in strategy? (2008) problems with 2 tags (1997) Show items based on login Password (2003) question on max variable in searching... (2000) send mail problem? (1997) WebCat2 several catalogs? (1997) Formatting a .txt file (1998) Webten + Webcat running smooth (1998) Founditems (1998) PCS Frames (1997) [convertChars] and HTML Tags (1997)