Re: [gentoo-user] shell script

2006-04-18 Thread Boyd Stephen Smith Jr.
On Tuesday 18 April 2006 07:11, Benno Schulenberg <[EMAIL PROTECTED]> wrote about 'Re: [gentoo-user] shell script': > Zac Slade wrote: > > On Tuesday 18 April 2006 00:34, [EMAIL PROTECTED] wrote: > > > In a shellp script, let > > >STRING="

Re: [gentoo-user] shell script

2006-04-18 Thread Benno Schulenberg
Zac Slade wrote: > On Tuesday 18 April 2006 00:34, [EMAIL PROTECTED] wrote: > > In a shellp script, let > >STRING="a.txt b.txt c.txt" > > And I want to delete a sub-string from $STRING, for example > > b.txt, and then we got > >$STRING is "a.txt c.txt" > > So for what you want just

Re: [gentoo-user] shell script

2006-04-17 Thread Zac Slade
On Tuesday 18 April 2006 00:34, [EMAIL PROTECTED] wrote: > In a shellp script, let >STRING="a.txt b.txt c.txt" > And I want to delete a sub-string from $STRING, for example > b.txt, and then we got >$STRING is "a.txt c.txt" > > How to achieve it? >From man bash: ${parameter:-word} U

[gentoo-user] shell script

2006-04-17 Thread scwang
In a shellp script, let STRING="a.txt b.txt c.txt" And I want to delete a sub-string from $STRING, for example b.txt, and then we got $STRING is "a.txt c.txt" How to achieve it? -- scwang -- gentoo-user@gentoo.org mailing list

Re: [gentoo-user] Shell Script runs fine directly, fails in crontab

2005-06-10 Thread Alin Dobre
On 6/2/05, fire-eyes <[EMAIL PROTECTED]> wrote: > On Thu, 2005-06-02 at 14:54 -0400, Dave Nebinger wrote: > > Sometimes there are environmental differences that are not immediately > > obvious between executing a command at the shell vs. within a cron task. > > > > A great hint I saw was to use the

RE: [gentoo-user] Shell Script runs fine directly, fails in crontab

2005-06-02 Thread fire-eyes
On Thu, 2005-06-02 at 14:54 -0400, Dave Nebinger wrote: > Sometimes there are environmental differences that are not immediately > obvious between executing a command at the shell vs. within a cron task. > > A great hint I saw was to use the 'sys-process/at' package's command to > schedule the scr

RE: [gentoo-user] Shell Script runs fine directly, fails in crontab

2005-06-02 Thread Dave Nebinger
Sometimes there are environmental differences that are not immediately obvious between executing a command at the shell vs. within a cron task. A great hint I saw was to use the 'sys-process/at' package's command to schedule the script to run some time in the future. Then go to the /var/spool/at

Re: [gentoo-user] Shell Script runs fine directly, fails in crontab

2005-06-02 Thread fire-eyes
On Thu, 2005-06-02 at 14:17 -0300, Daniel da Veiga wrote: > Check if root will run the process and if the environment where the > script will run is correct (like shell and umask). I'm not sure, but a > #! usually makes my scripts run correctly at cron. Yep my first line is #!/bin/sh. -- gentoo

Re: [gentoo-user] Shell Script runs fine directly, fails in crontab

2005-06-02 Thread fire-eyes
On Thu, 2005-06-02 at 12:37 -0400, A. Khattri wrote: > On Thu, 2 Jun 2005, fire-eyes wrote: > > > However, when I run it from cron as the same shell script (and redirect > > STDERR and STDOUT to files): > > > > ppp0: error fetching interface information: Device not found > > Is it running as roo

Re: [gentoo-user] Shell Script runs fine directly, fails in crontab

2005-06-02 Thread Daniel da Veiga
Check if root will run the process and if the environment where the script will run is correct (like shell and umask). I'm not sure, but a #! usually makes my scripts run correctly at cron. On 6/2/05, A. Khattri <[EMAIL PROTECTED]> wrote: > On Thu, 2 Jun 2005, fire-eyes wrote: > > > However, when

Re: [gentoo-user] Shell Script runs fine directly, fails in crontab

2005-06-02 Thread A. Khattri
On Thu, 2 Jun 2005, fire-eyes wrote: > However, when I run it from cron as the same shell script (and redirect > STDERR and STDOUT to files): > > ppp0: error fetching interface information: Device not found Is it running as root from crontab? -- -- gentoo-user@gentoo.org mailing list

[gentoo-user] Shell Script runs fine directly, fails in crontab

2005-06-02 Thread fire-eyes
I built the following shell script to bring up a pptp tunnel, grab a file via rsync, change some perms, and bring the tunnel down. When I run it directly logged in as root, I don't get problems. /usr/sbin/pon det-cle && \ sleep 3 ppp0_address=$(/sbin/ifconfig ppp0 | grep addr | awk '{print $2}' |