Re: [shell]
This WebDNA talk-list message is from 2002
It keeps the original formatting.
numero = 46418
interpreted = N
texte = ok. it's me again. just tried every single option suggested and myoriginal one (which again worked fine directly from the command line) andthe [shell] isn't doing it. on the command line doesn't matter what user isexecuting the command - it works fine. i don't have to use sudo..command line:./replc.sh <\!--HAS_WEBDNA_TAGS--> <\!--HAS_WEBDNA_TAGS-->[include\/includes\/counters\/booooo_counter.inc]/path/to/file/moo.htmlworks fine. the same thing in [shell]s doesn't....i even tried putting [raw] around the command...any other ideas why this wont do it in [shell]s?thanks...On Wed, 18 Dec 2002, Kalin Mintchev wrote:>> sorry.... no..> this is what i have in the file now:>> [text]old=<\!--HAS_WEBDNA_TAGS-->[/text]> [text]new=<\!--HAS_WEBDNA_TAGS-->[include> \/includes\/counters\/bobo_counter.inc][/text]> [text]file=/path/to/my/file.html[/text]>>>>> [shell]> sed s/[old]/[new]/g [file] > [file].new> [/shell]>> [renamefile from=[file].new&to=[file]]>> no good....> i'll just stop for tonight it's 3:30 am and i need some sleep...>> thanks...>>>> On Wed, 18 Dec 2002, Alain Russell wrote:>> > Any reason you don't just use WebDNA variables inside the script ..> >> > [text]old=<\!--HAS_WEBDNA_TAGS-->[/text]> > [text]new=<\!--HAS_WEBDNA_TAGS-->[/text]> > [text]file=/the/file/here[/text]> >> > [shell]> > sed s/[old]/[new]/g [file] > [file].new> > [/shell]> >> > [renamefile from=[file].new&to=[file]]> >> > We try and keep as much as possible in WebDNA code and just use [shell] for> > the minimum possible.> >> > Alain> >> >> >> > >> > > ok..> > > i'm not sure actually if i can do that. this is it:> > >> > >> > > [shell]> > > OLD=<\!--HAS_WEBDNA_TAGS-->> > > NEW=<\!--HAS_WEBDNA_TAGS-->[include> > > \/path\/to\/counters\/counter.inc]> > > FILE=/path/to/my/file.html> > > sed s/$OLD/$NEW/g $FILE > $FILE.new> > > /bin/mv $FILE.new $FILE> > > [/shell]> > >> > > didn't work.... the script actally is like this:> > >> > > #!/bin/sh> > > OLD=$1 # first parameter of the script> > > NEW=$2 # second parameter> > > shift ; shift # discard the first 2 parameters: the next are the file> > > for file in $* # for all files given as parameters> > > do> > > # replace every occurrence of OLD with NEW, save on a temporary file> > > sed s/$OLD/$NEW/g ${file} > ${file}.new> > > # rename the temporary file as the original file> > > /bin/mv ${file}.new ${file}> > > done> > >> > > and this works on the command line without sudoing to anything...> > >> > > y> > > On Wed, 18 Dec 2002, Kalin Mintchev wrote:> > >> > >>> > >> yea i did. that was my first test... i'll do it again - just a minute...> > >>> > >> On Wed, 18 Dec 2002, Alain Russell wrote:> > >>> > >>> Ah .. Linux, not OSX> > >>> Have you tried running the script inside of [shell] as opposed to calling a> > >>> script ..> > >>>> > >>> Take the contents of the script and try it within [shell][/shell]> > >>>> > >>>> On Wed, 18 Dec 2002, Alain Russell wrote:> > >>>>> > >>>>> If you run this from the command line .. NOT inside [shell] the system> > >>>>> will> > >>>>> execute the command as the user 'www' the same as webdna runs as - to see> > >>>>> if> > >>>>> it does what it is supposed to.> > >>>>> > >>>> that i know. my webdna runs under nobody.. that's the one i used and it> > >>>> didn't> > >>>> work..> > >>>>> > >>>>>> > >>>>>> Sudo -u www ./replc.sh <\!--HAS_WEBDNA_TAGS--> .. .etc didn't work....> > >>>>>> > >>>>>> > >>>>> -------------------------------------------------------------> > >>>>> 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/> > >>>> > >>>> > >>> -------------------------------------------------------------> > >>> 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/> > >>> > >> > >> > > -------------------------------------------------------------> > > 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/> >>>> -------------------------------------------------------------> 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:
ok. it's me again. just tried every single option suggested and myoriginal one (which again worked fine directly from the command line) andthe [shell] isn't doing it. on the command line doesn't matter what user isexecuting the command - it works fine. i don't have to use sudo..command line:./replc.sh <\!--HAS_WEBDNA_TAGS--> <\!--HAS_WEBDNA_TAGS-->[include\/includes\/counters\/booooo_counter.inc]/path/to/file/moo.htmlworks fine. the same thing in [shell]s doesn't....i even tried putting [raw] around the command...any other ideas why this wont do it in [shell]s?thanks...On Wed, 18 Dec 2002, Kalin Mintchev wrote:>> sorry.... no..> this is what i have in the file now:>> [text]old=<\!--HAS_WEBDNA_TAGS-->[/text]> [text]new=<\!--HAS_WEBDNA_TAGS-->[include> \/includes\/counters\/bobo_counter.inc][/text]> [text]file=/path/to/my/file.html[/text]>>>>> [shell]> sed s/[old]/[new]/g [file] > [file].new> [/shell]>> [renamefile from=[file].new&to=[file]]>> no good....> i'll just stop for tonight it's 3:30 am and i need some sleep...>> thanks...>>>> On Wed, 18 Dec 2002, Alain Russell wrote:>> > Any reason you don't just use WebDNA variables inside the script ..> >> > [text]old=<\!--HAS_WEBDNA_TAGS-->[/text]> > [text]new=<\!--HAS_WEBDNA_TAGS-->[/text]> > [text]file=/the/file/here[/text]> >> > [shell]> > sed s/[old]/[new]/g [file] > [file].new> > [/shell]> >> > [renamefile from=[file].new&to=[file]]> >> > We try and keep as much as possible in WebDNA code and just use [shell] for> > the minimum possible.> >> > Alain> >> >> >> > >> > > ok..> > > i'm not sure actually if i can do that. this is it:> > >> > >> > > [shell]> > > OLD=<\!--HAS_WEBDNA_TAGS-->> > > NEW=<\!--HAS_WEBDNA_TAGS-->[include> > > \/path\/to\/counters\/counter.inc]> > > FILE=/path/to/my/file.html> > > sed s/$OLD/$NEW/g $FILE > $FILE.new> > > /bin/mv $FILE.new $FILE> > > [/shell]> > >> > > didn't work.... the script actally is like this:> > >> > > #!/bin/sh> > > OLD=$1 # first parameter of the script> > > NEW=$2 # second parameter> > > shift ; shift # discard the first 2 parameters: the next are the file> > > for file in $* # for all files given as parameters> > > do> > > # replace every occurrence of OLD with NEW, save on a temporary file> > > sed s/$OLD/$NEW/g ${file} > ${file}.new> > > # rename the temporary file as the original file> > > /bin/mv ${file}.new ${file}> > > done> > >> > > and this works on the command line without sudoing to anything...> > >> > > y> > > On Wed, 18 Dec 2002, Kalin Mintchev wrote:> > >> > >>> > >> yea i did. that was my first test... i'll do it again - just a minute...> > >>> > >> On Wed, 18 Dec 2002, Alain Russell wrote:> > >>> > >>> Ah .. Linux, not OSX> > >>> Have you tried running the script inside of [shell] as opposed to calling a> > >>> script ..> > >>>> > >>> Take the contents of the script and try it within [shell][/shell]> > >>>> > >>>> On Wed, 18 Dec 2002, Alain Russell wrote:> > >>>>> > >>>>> If you run this from the command line .. NOT inside [shell] the system> > >>>>> will> > >>>>> execute the command as the user 'www' the same as webdna runs as - to see> > >>>>> if> > >>>>> it does what it is supposed to.> > >>>>> > >>>> that i know. my webdna runs under nobody.. that's the one i used and it> > >>>> didn't> > >>>> work..> > >>>>> > >>>>>> > >>>>>> Sudo -u www ./replc.sh <\!--HAS_WEBDNA_TAGS--> .. .etc didn't work....> > >>>>>> > >>>>>> > >>>>> -------------------------------------------------------------> > >>>>> 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/> > >>>> > >>>> > >>> -------------------------------------------------------------> > >>> 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/> > >>> > >> > >> > > -------------------------------------------------------------> > > 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/> >>>> -------------------------------------------------------------> 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/
Kalin Mintchev
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:
Searching multiple Databases (1997)
Server slowing down. (1997)
Online reference (1997)
Showing unopened cart (1997)
Frames and WebCat (1997)
Summing fields (1997)
[WebDNA] unix timestamp in WebDNA (2009)
convertWords... NEW (2001)
Trouble serving graphics on protected templates (1998)
Major Security Hole (1998)
RE: formula.db, adding option prices (1997)
[GROUPS] followup (1997)
WebCat B13 Mac CGI -- Frames question (1997)
PGP encrypted email (1998)
Anyone using Verisign's Payflow Link for payment processing? (2000)
Searching (2005)
CloseDataBase vs CommitDataBase (2007)
Bannerad Demo (1998)
SMSI -- a [notfound] context? (2002)
[OT] How'd it go, Sal? (2006)