Re: Stupid bash scripting question

2005-08-25 Thread Michael ODonnell
>> It seems that either will do the job, I'm just wondering (for the >> purpose of my own "betterment" and improved knowledge of shell scripting >> *grin*) about advantages of either approach. The only one I've come >> with so far is that Solution 2 requires a separate process to run. > >So does

Re: Stupid bash scripting question

2005-08-24 Thread John Abreau
On Wed, 24 Aug 2005, Cole Tuininga wrote: > It seems that either will do the job, I'm just wondering (for the > purpose of my own "betterment" and improved knowledge of shell scripting > *grin*) about advantages of either approach. The only one I've come > with so far is that Solution 2 requires

Re: Stupid bash scripting question

2005-08-24 Thread John Abreau
On Wed, 24 Aug 2005, Cole Tuininga wrote: > > Ok - I'm sure the answer to this is simple, but I can't seem to figure > the darned thing out. In my defense, it's extremely rare that I do any > shell scripting. 8) > > Basically, the deal is that I have a variable that contains a string > such as

Re: Stupid bash scripting question

2005-08-24 Thread Steven W. Orr
On Wednesday, Aug 24th 2005 at 10:32 -0400, quoth Cole Tuininga: =>I've received two different responses to this request - both of which =>seem to work just fine. My thanks to those who responded. I'm a little =>curious if one solution has any advantages over the other: => =>Solution 1: => =>use

Re: Stupid bash scripting question

2005-08-24 Thread Cole Tuininga
On Wed, 2005-08-24 at 10:06 -0400, Bill Sconce wrote: > On Wed, 24 Aug 2005 09:43:46 -0400 > Cole Tuininga <[EMAIL PROTECTED]> wrote: > > > > > Ok - I'm sure the answer to this is simple, but I can't seem to figure > > the darned thing out. In my defense, it's extremely rare that I do any > > sh

Re: Stupid bash scripting question

2005-08-24 Thread Kenneth E. Lussier
On Wed, 2005-08-24 at 10:32 -0400, Cole Tuininga wrote: > I've received two different responses to this request - both of which > seem to work just fine. My thanks to those who responded. I'm a little > curious if one solution has any advantages over the other: > > Solution 1: > > user="usernam

Re: Stupid bash scripting question

2005-08-24 Thread Cole Tuininga
I've received two different responses to this request - both of which seem to work just fine. My thanks to those who responded. I'm a little curious if one solution has any advantages over the other: Solution 1: user="username" f=`eval "echo ~${user}"` Solution 2: user="username" f=`getent p

Re: Stupid bash scripting question

2005-08-24 Thread Andrew W. Gaunt
Somthing like this perhaps? $ user="quantum" $ f=`getent passwd $user|cut -f6 -d:` $ echo $f /home/quantum Cole Tuininga wrote: Ok - I'm sure the answer to this is simple, but I can't seem to figure the darned thing out. In my defense, it's

Re: Stupid bash scripting question

2005-08-24 Thread Kevin D. Clark
Cole Tuininga writes: > In other words, if I have something like: > > user="username" > f="~${user}" > > I'd like $f to end up with the path to username's actual home. As it > is, it just has the value "~username". What magic do I need to do on my > f assignment line?! user=username f=`eval ec

Re: Stupid bash scripting question

2005-08-24 Thread Bill Sconce
On Wed, 24 Aug 2005 09:43:46 -0400 Cole Tuininga <[EMAIL PROTECTED]> wrote: > > Ok - I'm sure the answer to this is simple, but I can't seem to figure > the darned thing out. In my defense, it's extremely rare that I do any > shell scripting. 8) It IS grungier than Python, eh? > Basically,

Stupid bash scripting question

2005-08-24 Thread Cole Tuininga
Ok - I'm sure the answer to this is simple, but I can't seem to figure the darned thing out. In my defense, it's extremely rare that I do any shell scripting. 8) Basically, the deal is that I have a variable that contains a string such as "~username". I'd like to actually expand that to the us