Re: bash script question

2009-12-01 Thread Gary Kline
On Tue, Dec 01, 2009 at 11:10:33PM +0100, Polytropon wrote: > On Tue, 1 Dec 2009 13:45:55 -0800, Gary Kline wrote: > > Hi guys, > > > > Here's a bash-related question, kind-of. Is there any way to > > automagically run my .csrhc thru a script and wind up with a > > bash script?

Re: bash script question

2009-12-01 Thread Gary Kline
On Tue, Dec 01, 2009 at 11:02:07PM +0100, Rolf G Nielsen wrote: > Gary Kline wrote: > >On Tue, Dec 01, 2009 at 10:42:10PM +0100, Polytropon wrote: > >>On Tue, 01 Dec 2009 21:06:34 +0100, Rolf G Nielsen > >> wrote: > >>>Why are you using bash? To make a shell script as portable as possible, > >>>u

Re: bash script question

2009-12-01 Thread Polytropon
On Tue, 1 Dec 2009 13:45:55 -0800, Gary Kline wrote: > Hi guys, > > Here's a bash-related question, kind-of. Is there any way to > automagically run my .csrhc thru a script and wind up with a > bash script? csh and (ba)sh use dufferent syntax and variable names. But you

Re: bash script question

2009-12-01 Thread Rolf G Nielsen
Gary Kline wrote: On Tue, Dec 01, 2009 at 10:42:10PM +0100, Polytropon wrote: On Tue, 01 Dec 2009 21:06:34 +0100, Rolf G Nielsen wrote: Why are you using bash? To make a shell script as portable as possible, use /bin/sh. Bash is a third party shell, that isn't included in a base installation

Re: bash script question

2009-12-01 Thread Gary Kline
On Tue, Dec 01, 2009 at 10:42:10PM +0100, Polytropon wrote: > On Tue, 01 Dec 2009 21:06:34 +0100, Rolf G Nielsen > wrote: > > Why are you using bash? To make a shell script as portable as possible, > > use /bin/sh. Bash is a third party shell, that isn't included in a base > > installation (you

Re: bash script question

2009-12-01 Thread Polytropon
On Tue, 01 Dec 2009 21:06:34 +0100, Rolf G Nielsen wrote: > Why are you using bash? To make a shell script as portable as possible, > use /bin/sh. Bash is a third party shell, that isn't included in a base > installation (you're not using bash as root's shell, are you?). By using > /bin/sh, yo

Re: bash script question

2009-12-01 Thread Rolf G Nielsen
Dánielisz László wrote: I just find out: #!/usr/local/bin/bash export IFS=" " cuc=$* mkdir "cuc" Thanks anyway! László From: Dánielisz László To: freebsd-questions@freebsd.org Sent: Tue, December 1, 2009 8:37:04 PM Subject: bash scr

Re: bash script question

2009-12-01 Thread Polytropon
On Tue, 1 Dec 2009 11:48:43 -0800 (PST), Dánielisz László wrote: > I just find out: > > #!/usr/local/bin/bash > export IFS=" " > cuc=$* > mkdir "cuc" The $* variable will expand to all arguments given on the command line, e. g. $ ./myscript foo bar baz will result in mkdir "f

bash script question

2009-12-01 Thread Dánielisz László
Hello, I'd like to ask how can I read a variable in the same line when I launch a script? For example "./script.sh directory_name", and I want the script to creat the directory called "directory_name" or whatever I input there. Thank you! László __

Re: bash script question

2009-12-01 Thread Dánielisz László
I just find out: #!/usr/local/bin/bash export IFS=" " cuc=$* mkdir "cuc" Thanks anyway! László From: Dánielisz László To: freebsd-questions@freebsd.org Sent: Tue, December 1, 2009 8:37:04 PM Subject: bash script question Hello, I