update automaticly

2006-10-19 Thread sonjaya

i have script for update automaticly here:
# cat /root/update_part1.sh
#!/bin/csh
cd /usr/src
setenv CVS_CLIENT_PORT -1
setenv CVSROOT [EMAIL PROTECTED]:/cvs
cvs -d $CVSROOT -q up -rOPENBSD_3_9 -Pd
date  /root/update_part1.log

when i try run that script get error such like this :
# sh /root/update_part1.sh
/root/update_part1.sh[3]: setenv: not found
/root/update_part1.sh[4]: setenv: not found
cvs update: CVSROOT -q must be an absolute pathname
cvs [update aborted]: Bad CVSROOT.

please tell me to fix it .


--
-sonjaya-



Re: update automaticly

2006-10-19 Thread Marcus Popp
On 2006-10-19T21:28, sonjaya wrote:
 i have script for update automaticly here:
 # cat /root/update_part1.sh
 #!/bin/csh
 cd /usr/src
 setenv CVS_CLIENT_PORT -1
 setenv CVSROOT [EMAIL PROTECTED]:/cvs
 cvs -d $CVSROOT -q up -rOPENBSD_3_9 -Pd
 date  /root/update_part1.log
 
 when i try run that script get error such like this :
 # sh /root/update_part1.sh
 /root/update_part1.sh[3]: setenv: not found
 /root/update_part1.sh[4]: setenv: not found
 cvs update: CVSROOT -q must be an absolute pathname
 cvs [update aborted]: Bad CVSROOT.
 
 please tell me to fix it .

fix it ;-)

try # /root/update_part1.sh
sh don't know setenv

hth,

Marcus.



Re: update automaticly

2006-10-19 Thread Stuart Henderson
On 2006/10/19 21:28, sonjaya wrote:
 i have script for update automaticly here:
 #!/bin/csh

c-shell for scripting? are you mad? :-)

 cd /usr/src
 setenv CVS_CLIENT_PORT -1
 setenv CVSROOT [EMAIL PROTECTED]:/cvs
 cvs -d $CVSROOT -q up -rOPENBSD_3_9 -Pd
 date  /root/update_part1.log
 
 when i try run that script get error such like this :
 # sh /root/update_part1.sh

...and now you try and run it under Bourne shell.
either /root/update_part1.sh or csh /root/update_part1.sh.

I don't think I'd run it as root either, tbh.



Re: update automaticly

2006-10-19 Thread Dries Schellekens

sonjaya wrote:

i have script for update automaticly here:
# cat /root/update_part1.sh
#!/bin/csh
cd /usr/src
setenv CVS_CLIENT_PORT -1
setenv CVSROOT [EMAIL PROTECTED]:/cvs
cvs -d $CVSROOT -q up -rOPENBSD_3_9 -Pd
date  /root/update_part1.log

when i try run that script get error such like this :
# sh /root/update_part1.sh
/root/update_part1.sh[3]: setenv: not found
/root/update_part1.sh[4]: setenv: not found
cvs update: CVSROOT -q must be an absolute pathname
cvs [update aborted]: Bad CVSROOT.

please tell me to fix it .


You are forcing ksh do execute a csh script. Either you rewrite it to 
ksh; so using export instead of setenv. Either you execute the script 
differently. Make it executable and run it without the sh in front



Cheers,

Dries



Re: update automaticly

2006-10-19 Thread Marc Espie
On Thu, Oct 19, 2006 at 09:28:23PM +0700, sonjaya wrote:
 i have script for update automaticly here:
 # cat /root/update_part1.sh
 #!/bin/csh
 
 cd /usr/src
 setenv CVS_CLIENT_PORT -1
 setenv CVSROOT [EMAIL PROTECTED]:/cvs
 cvs -d $CVSROOT -q up -rOPENBSD_3_9 -Pd
 date  /root/update_part1.log
 
 when i try run that script get error such like this :
 # sh /root/update_part1.sh
^^
 /root/update_part1.sh[3]: setenv: not found
 /root/update_part1.sh[4]: setenv: not found
 cvs update: CVSROOT -q must be an absolute pathname
 cvs [update aborted]: Bad CVSROOT.
 
 please tell me to fix it .

You have to choose one shell and stick to it



Re: update automaticly

2006-10-19 Thread Will Maier
On Thu, Oct 19, 2006 at 09:28:23PM +0700, sonjaya wrote:
 i have script for update automaticly here:
 # cat /root/update_part1.sh
 #!/bin/csh
 cd /usr/src
 setenv CVS_CLIENT_PORT -1
 setenv CVSROOT [EMAIL PROTECTED]:/cvs
 cvs -d $CVSROOT -q up -rOPENBSD_3_9 -Pd
 date  /root/update_part1.log
 
 when i try run that script get error such like this :
 # sh /root/update_part1.sh
 /root/update_part1.sh[3]: setenv: not found
 /root/update_part1.sh[4]: setenv: not found
 cvs update: CVSROOT -q must be an absolute pathname
 cvs [update aborted]: Bad CVSROOT.

sh(1) isn't csh(1) -- if you run `sh your_csh_script.sh`, sh ignores
the interpreter line and tries to run the script itself. sh doesn't
use setenv, which is why you get 'setenv: not found.'

If I were you, I'd write the script in sh. csh has long been
considered harmful, and isn't very much fun to write.

-- 

o--{ Will Maier }--o
| web:...http://www.lfod.us/ | [EMAIL PROTECTED] |
*--[ BSD Unix: Live Free or Die ]--*



Re: update automaticly

2006-10-19 Thread Aleksandar Milosevic

sonjaya wrote:

i have script for update automaticly here:
# cat /root/update_part1.sh
#!/bin/csh
cd /usr/src
setenv CVS_CLIENT_PORT -1
setenv CVSROOT [EMAIL PROTECTED]:/cvs
cvs -d $CVSROOT -q up -rOPENBSD_3_9 -Pd
date  /root/update_part1.log

when i try run that script get error such like this :
# sh /root/update_part1.sh


# csh /root/update_part1.sh



Re: update automaticly

2006-10-19 Thread Girish Venkatachalam
On Thu, Oct 19, 2006 at 03:43:50PM +0100, Stuart Henderson wrote:
 On 2006/10/19 21:28, sonjaya wrote:
  i have script for update automaticly here:
  #!/bin/csh
 
 c-shell for scripting? are you mad? :-)

IMAO csh should be banished from earth! :-)

You will be amazed how brain dead its design is :-)

Go figure. There is a wonderful and interesting document somewhere on the 
Internet that colorfully and sleazily takes you thro' why it is so f***ed up