shell programming question: help with expr command

2011-04-09 Thread Dino Vliet
Hi folks, I'm having trouble with a little shell script. Can somebody explain me why I get 3 times expr: syntax  error in my console after I run this little script? #! /usr/local/bin/bash # testscript var1=trees.J48 #other value will be rules.Jrip, rules.DecisionTable len=${#var1} ind=`expr

Re: shell programming question: help with expr command

2011-04-09 Thread Polytropon
On Sat, 9 Apr 2011 06:31:28 -0700 (PDT), Dino Vliet dino_vl...@yahoo.com wrote: Hi folks, I'm having trouble with a little shell script. Can somebody explain me why I get 3 times expr: syntax  error in my console after I run this little script? #! /usr/local/bin/bash # testscript

Re: shell programming question: help with expr command

2011-04-09 Thread Devin Teske
On Apr 9, 2011, at 6:31 AM, Dino Vliet dino_vl...@yahoo.com wrote: Hi folks, I'm having trouble with a little shell script. Can somebody explain me why I get 3 times expr: syntax error in my console after I run this little script? #! /usr/local/bin/bash # testscript var1=trees.J48

Online shell programming training for novices

2008-04-05 Thread Gaspar Chilingarov
Hi there ! I'm going to start soon (10-14 apr) free online training for novices in unixes and especially FreeBSD. If you would like to participate - join us. Please check more details on http://community.livejournal.com/bin_sh_en/348.html I will post announce also to Linux communities,

Re: shell programming

2007-11-14 Thread Bill Banks
What am I doing wrough here: #!/bin/sh $DAYN='/bin/date +%a' + _master.sql mysqldump master $DAYN Wojciech Puchar wrote: dayoftheweek=`date +%w` On Fri, 9 Nov 2007, Bill Banks wrote: I'm writing a backup script. I need to get the day of the week into a variable. How can I do it? --

Re: shell programming

2007-11-14 Thread Bill Banks
thanks Bill Moran wrote: In response to Bill Banks [EMAIL PROTECTED]: What am I doing wrough here: #!/bin/sh $DAYN='/bin/date +%a' + _master.sql mysqldump master $DAYN Those look to be single quotes and not backquotes. (backquote is the upper left key on most keyboards)

Re: shell programming

2007-11-14 Thread Bill Moran
In response to Bill Banks [EMAIL PROTECTED]: What am I doing wrough here: #!/bin/sh $DAYN='/bin/date +%a' + _master.sql mysqldump master $DAYN Those look to be single quotes and not backquotes. (backquote is the upper left key on most keyboards) Wojciech Puchar wrote:

RE: shell programming

2007-11-14 Thread Barry Byrne
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bill Banks Sent: 14 November 2007 17:25 To: FreeBSD Questions Subject: Re: shell programming What am I doing wrough here: #!/bin/sh $DAYN='/bin/date +%a' + _master.sql mysqldump master $DAYN

Re: shell programming

2007-11-09 Thread Eric Crist
On Nov 9, 2007, at 11:46 AM, Bill Banks wrote: I'm writing a backup script. I need to get the day of the week into a variable. How can I do it? Well, it depends on what you're using. If you're using sh, see `man date`. If you're using perl, it's quite complicated. In short, with sh,

shell programming

2007-11-09 Thread Bill Banks
I'm writing a backup script. I need to get the day of the week into a variable. How can I do it? -- --- Bill Banks 508-829-2005 Wachusett Programming Ourweb http://www.ourweb.net http://www.ourwebtemplates.com

Re: shell programming

2007-11-09 Thread Derek Ragona
At 11:46 AM 11/9/2007, Bill Banks wrote: I'm writing a backup script. I need to get the day of the week into a variable. How can I do it? I do this in ksh, but it should work in sh too: DATE=/bin/date TODAY=`$DATE +%m-%d-%Y` TIME=`$DATE +%H:%M:%S` echo Backups started $TODAY at $TIME

Re: shell programming

2007-11-09 Thread Bill Banks
thanks Eric Crist wrote: On Nov 9, 2007, at 11:46 AM, Bill Banks wrote: I'm writing a backup script. I need to get the day of the week into a variable. How can I do it? Well, it depends on what you're using. If you're using sh, see `man date`. If you're using perl, it's quite

Re: shell programming

2007-11-09 Thread Jonathan McKeown
On Friday 09 November 2007 20:02, Eric Crist wrote: On Nov 9, 2007, at 11:46 AM, Bill Banks wrote: I'm writing a backup script. I need to get the day of the week into a variable. How can I do it? Well, it depends on what you're using. If you're using sh, see `man date`. If you're using

Re: shell programming challenge

2004-12-03 Thread Don Wilde
Resolved: After a bit more work and lots of good suggestions, I came up with xterm -e bash --rcfile .myrcfile -i -c ./ticktock exec bash It does everything I was expecting (assuming your regular .bashrc doesn't trash the things you set up in the first environment!) Thanks, all! -- Don Wilde

Re: shell programming challenge

2004-11-26 Thread Jan Grant
On Thu, 25 Nov 2004, Don Wilde wrote: J65nko BSD wrote: On Thu, 25 Nov 2004 10:26:38 -0700, Don Wilde [EMAIL PROTECTED] wrote: Hey, folks - I need to find a way to kick off an xterm running BASH and then execute a program within that xterm, but NOT close the new xterm after the

Re: shell programming challenge

2004-11-26 Thread Giorgos Keramidas
On 2004-11-25 17:30, Conrad J. Sabatier [EMAIL PROTECTED] wrote: OK, I think I've found what you're looking for: xterm -e /usr/local/bin/bash --rcfile bash_commands -i Substitute your program's startup script for bash_commands in the above. Using the -i switch to bash forces interactive

Re: shell programming challenge

2004-11-26 Thread Don Wilde
If you have the option to modify it, ensure that your script exits via exec sh. Alternatively a wrapper that does this is straightforward to build. It's looking more and more that I need to make a temporary file that packages both the init file and the program command line (eval blah...)

Re: shell programming challenge

2004-11-26 Thread Adam Fabian
with. You may also be trying to do something complex enough that it's just more trouble than it's worth to do it with shell programming. Anyway, good luck. -- Adam Fabian ([EMAIL PROTECTED]) ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org

Re: shell programming challenge

2004-11-26 Thread Conrad J. Sabatier
On Fri, 26 Nov 2004 13:57:31 +0200, Giorgos Keramidas [EMAIL PROTECTED] wrote: On 2004-11-25 17:30, Conrad J. Sabatier [EMAIL PROTECTED] wrote: OK, I think I've found what you're looking for: xterm -e /usr/local/bin/bash --rcfile bash_commands -i Substitute your program's startup

shell programming challenge

2004-11-25 Thread Don Wilde
Hey, folks - I need to find a way to kick off an xterm running BASH and then execute a program within that xterm, but NOT close the new xterm after the program finishes. Another desirable thing would be to also be able to 'source in' a file of shell environment that would affect the new window

Re: shell programming challenge

2004-11-25 Thread Adam Fabian
On Thu, Nov 25, 2004 at 10:26:38AM -0700, Don Wilde wrote: Hey, folks - I need to find a way to kick off an xterm running BASH and then execute a program within that xterm, but NOT close the new xterm after the program finishes. Another desirable thing would be to also be able to 'source

Re: shell programming challenge

2004-11-25 Thread Adam Fabian
On Thu, Nov 25, 2004 at 10:26:38AM -0700, Don Wilde wrote: completion of ticktock or INT. I also do not seem to be able to use the --rcfile switch as a bash option, although I can add KEY=VALUE pairs before the xterm launch. Oops. Didn't notice this until after I replied, but I did test

Re: shell programming challenge

2004-11-25 Thread Don Wilde
Adam Fabian wrote: On Thu, Nov 25, 2004 at 10:26:38AM -0700, Don Wilde wrote: Hey, folks - I need to find a way to kick off an xterm running BASH and then execute a program within that xterm, but NOT close the new xterm after the program finishes. Another desirable thing would be to also be able

Re: shell programming challenge

2004-11-25 Thread Don Wilde
J65nko BSD wrote: On Thu, 25 Nov 2004 10:26:38 -0700, Don Wilde [EMAIL PROTECTED] wrote: Hey, folks - I need to find a way to kick off an xterm running BASH and then execute a program within that xterm, but NOT close the new xterm after the program finishes. [snip] xterm -hold -e sh -c

Re: shell programming challenge

2004-11-25 Thread Conrad J. Sabatier
On Thu, 2004-11-25 at 10:26 -0700, Don Wilde wrote: Hey, folks - I need to find a way to kick off an xterm running BASH and then execute a program within that xterm, but NOT close the new xterm after the program finishes. Another desirable thing would be to also be able to 'source in' a

Re: shell programming challenge

2004-11-25 Thread Don Wilde
When I do this, the program works interacts, but the xterm dies upon completion of ticktock or INT. I also do not seem to be able to use the --rcfile switch as a bash option, although I can add KEY=VALUE pairs before the xterm launch. Ideas? Please respond to me directly. man xterm. There

Re: shell programming challenge

2004-11-25 Thread Conrad J. Sabatier
On Thu, 25 Nov 2004 11:59:47 -0600, Conrad J. Sabatier [EMAIL PROTECTED] wrote: On Thu, 2004-11-25 at 10:26 -0700, Don Wilde wrote: Hey, folks - I need to find a way to kick off an xterm running BASH and then execute a program within that xterm, but NOT close the new xterm after the

Re: shell programming challenge

2004-11-25 Thread Adam Fabian
It's possible to generate temporary files in a secure manner; there's probably something in the ports collection to generate good, random file names. I'm not sure I'd go to so much trouble to avoid using a file for --init-file or --rc-file. That aside, you could try using expect to script the

Re: recommended book/guide for /bin/sh shell programming

2003-08-14 Thread Marvin J. Kosmal
the appropriate commands etc... As such, am looking for recommendations for a good guide/book or two for shell programming, but most of the books seem to be specific to bash, tcsh, ksh, etc... Given that there is a seperate bash shell port available, I would assume that /bin/sh != bash. I would prefer

recommended book/guide for /bin/sh shell programming

2003-08-14 Thread Dave [Hawk-Systems]
for a good guide/book or two for shell programming, but most of the books seem to be specific to bash, tcsh, ksh, etc... Given that there is a seperate bash shell port available, I would assume that /bin/sh != bash. I would prefer to use plain ol /bin/sh since most of the core scripts scattered through

Re: recommended book/guide for /bin/sh shell programming

2003-08-14 Thread Jez Hancock
On Wed, Aug 06, 2003 at 10:27:38PM +0100, Ceri Davies wrote: On Wed, Aug 06, 2003 at 05:21:16PM -0400, Dave [Hawk-Systems] wrote: As such, am looking for recommendations for a good guide/book or two for shell programming, but most of the books seem to be specific to bash, tcsh, ksh, etc

Re: recommended book/guide for /bin/sh shell programming

2003-08-08 Thread burningclown
may have already been mentioned, Bruce Blinn, Portable Shell Programming: An Extensive Collection of Bourne Shell Examples good stuff -glenn becker On 6 Aug 2003, Marvin J. Kosmal wrote: On Wed, 2003-08-06 at 14:21, Dave [Hawk-Systems] wrote: For multiple reasons I am moving away from

Re: recommended book/guide for /bin/sh shell programming

2003-08-07 Thread Ceri Davies
On Wed, Aug 06, 2003 at 05:21:16PM -0400, Dave [Hawk-Systems] wrote: As such, am looking for recommendations for a good guide/book or two for shell programming, but most of the books seem to be specific to bash, tcsh, ksh, etc... Given that there is a seperate bash shell port available, I

RE: shell programming - how to write a script that renames files after their last moddate?

2003-05-27 Thread Eduardo Viruena Silva
On Tue, 27 May 2003, Vince Hoffman wrote: This is certainly not freeBSD specific and probably I'm annoying someone for being off-topic but please be patient and hint me on where to find good resources in shell-programming. http://www.shelldorado.com/ isnt bad. otherwise comp.unix.shell