Shell Script Help

2006-01-29 Thread Angelo Christou
Hello, I am running FreeBSD 6.0 with Bash as my shell. I am trying to automate a task and I have been reading a lot about Bash, but I haven't been able to get a script working. I have a program that I need to pass 3 variables. I have a text file called list.txt that has the variables separated

Re: Shell Script Help

2006-01-29 Thread Proniewski Patrick
On 29 janv. 06, at 16:10, Angelo Christou wrote: list.txt contains: bob home 9002 jim data 9005 Running the following for each line is what I'm trying to do: myprogram bob home 9002 myprogram jim data 9005 and so on.. give this a try: while read myline; do set -- $myline

Re: Shell Script Help

2006-01-29 Thread Angelo Christou
Hello Patrick, Your suggestion works perfectly. Thank you very much for helping a learner such as myself. Ang. Proniewski Patrick [EMAIL PROTECTED] wrote: On 29 janv. 06, at 16:10, Angelo Christou wrote: list.txt contains: bob home 9002 jim data 9005 Running the following for each

Shell script help

2005-07-30 Thread Paul Schmehl
I'm working on a new port, and the one thing I can't seem to solve is the man pages. They install fine, but they're not formatted right. In the Makefile that is built from configure, this is the section that handles the man pages: @cd $(TOP_DIR)/doc; for i in *.n; \ do \

Re: Shell script help

2005-07-30 Thread Parv
in message [EMAIL PROTECTED], wrote Paul Schmehl thusly... Running what I *thought* was the same sed command in the Makefile of the port doesn't solve the problem of the formatting of the man pages, but it doesn't generate any errors either: @${SED} -e '/man\.macros/r man.macros' -e

Re: Shell script help

2005-07-30 Thread Parv
in message [EMAIL PROTECTED], wrote Parv thusly... in message [EMAIL PROTECTED], wrote Paul Schmehl thusly... @${SED} -e '/man\.macros/r man.macros' ... In the 1st part, sed sends the output of file 'man.macros' to ^ ^ ^ ^ ^ ^ ^

Re: Shell script help

2005-07-30 Thread Paul Schmehl
--On July 30, 2005 2:57:57 AM -0400 Parv [EMAIL PROTECTED] wrote: in message [EMAIL PROTECTED], wrote Paul Schmehl thusly... Running what I *thought* was the same sed command in the Makefile of the port doesn't solve the problem of the formatting of the man pages, but it doesn't generate any

Re: Shell script help

2005-07-30 Thread Parv
in message [EMAIL PROTECTED], wrote Paul Schmehl thusly... --On July 30, 2005 2:57:57 AM -0400 Parv [EMAIL PROTECTED] wrote: in message [EMAIL PROTECTED], wrote Paul Schmehl thusly... ... @${SED} -e '/man\.macros/r man.macros' -e '/man\.macros/d' ${WRKSRC}/doc/${f} \

Re: Shell script help

2005-06-30 Thread Kevin Kinsey
Norberto Meijome wrote: Kevin Kinsey wrote: = # Rule number variable RuleNum=100 # # this function increments $RulNum var by 100... # # inc () { RuleNum=$(expr $1 + 100) } ## # LET'S

Re: Shell script help

2005-06-29 Thread Björn König
Mike Jeays wrote: man expr to give the short answer to your first question: As an example, x=`expr $x + 1` 536 ~ $ x=4 537 ~ $ x=`expr $x + 1` 538 ~ $ echo $ Note the back-quotes to execute a command and return the result, and the need for spaces between each token in the expr command.

Shell script help

2005-06-28 Thread fbsd_user
My sh shell script ability is not that good. Have 2 simple coding problems. How do I code a statement to subtract one from a field. $rulenum = $rulenum - 1 $rulenum = '$rulenum - 1' one='1' $rulenum = $rulenum - $one $rulenum='$rulenum - $one' None of that works. must really be simple. I also

Re: Shell script help

2005-06-28 Thread Mike Jeays
On Tue, 2005-06-28 at 22:52, fbsd_user wrote: My sh shell script ability is not that good. Have 2 simple coding problems. How do I code a statement to subtract one from a field. $rulenum = $rulenum - 1 $rulenum = '$rulenum - 1' one='1' $rulenum = $rulenum - $one $rulenum='$rulenum -

Re: Shell script help

2005-06-28 Thread Kevin Kinsey
Mike Jeays wrote: On Tue, 2005-06-28 at 22:52, fbsd_user wrote: My sh shell script ability is not that good. Have 2 simple coding problems. How do I code a statement to subtract one from a field. $rulenum = $rulenum - 1 $rulenum = '$rulenum - 1' one='1' $rulenum = $rulenum - $one

Re: Shell script help

2005-06-28 Thread Norberto Meijome
Kevin Kinsey wrote: = # Rule number variable RuleNum=100 # # this function increments $RulNum var by 100... # # inc () { RuleNum=$(expr $1 + 100) } ## # LET'S GET STARTED #

drive space shell script help ?

2003-09-15 Thread Brent Bailey
Im trying to write a script that will email me when drive space on any given partition is above a certain value. i was trying this ...but no working ... #!/bin/sh # this is a script to check drive space and email HSD dept. # cd ~bbailey rm ~bbailey/drvspc.txt df -k | awk '{print$5}'

RE: drive space shell script help ?

2003-09-15 Thread Charles Howse
#!/bin/sh # this is a script to check drive space and email HSD dept. # cd ~bbailey rm ~bbailey/drvspc.txt df -k | awk '{print$5}' ~bbailey/drvspc.txt cat drvspc.txt while read i do if [$i '89']; then This line should be: if [ $i -gt 89 ] ; then The spaces between

RE: drive space shell script help ?

2003-09-15 Thread Charles Howse
The more I play with your script, the more fun it becomes. #!/bin/sh # this is a script to check drive space and email HSD dept. # cd ~bbailey rm drvspc.txt # Once I'm in ~bbailey, I don't need the complete path to any files there. df -k | # You have to get rid of the word 'Capacity' or your

RE: drive space shell script help ?

2003-09-15 Thread Brent Bailey
Awesome that worked ..Im also going to try some of the other options you had mentioned..I wanted to thank you for your help :-) This has got to be the best dam mailing list there is :-) -- Brent Bailey CCNA Bmyster LLC Computer Networking and Webhosting Network Engineer, Webmaster, President

shell script help

2003-07-23 Thread David Bear
I'm trying to clean up a script that controls my tape better. Among other things it sets some variable to use later. I've made an error somewhere and I'm thinking that I'm missing the obvious since I cant find the error. I want to set command line options for tar. Below taroptions has what I

Re: shell script help

2003-07-23 Thread Joe Marcus Clarke
On Wed, 2003-07-23 at 02:04, David Bear wrote: I'm trying to clean up a script that controls my tape better. Among other things it sets some variable to use later. I've made an error somewhere and I'm thinking that I'm missing the obvious since I cant find the error. I want to set command