Re: find help about 'read' built-in command

2007-11-15 Thread Bob Proulx
Andreas Schwab wrote: > Bob Proulx writes: > > Since $PWD is a bash specific feature > > It isn't. > > > would still tend to use $(pwd) because that works both in bash and in > > POSIX shells (would be okay with #!/bin/sh). > > $PWD works in every POSIX shell. Oh! I had it in my head that it w

Re: find help about 'read' built-in command

2007-11-15 Thread Andreas Schwab
[EMAIL PROTECTED] (Bob Proulx) writes: > Since $PWD is a bash specific feature It isn't. > would still tend to use $(pwd) because that works both in bash and in > POSIX shells (would be okay with #!/bin/sh). $PWD works in every POSIX shell. Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTE

Re: find help about 'read' built-in command

2007-11-14 Thread Bob Proulx
Mike Stroyan wrote: > 龙海涛 wrote: > > Bob Proulx wrote: > > > test=$(pwd) > > > echo $test > > By the way, the variable "$PWD" has the same current directory value > as "$(pwd)" . Yes, you have a point, but... Even though this is a bash list I still prefer to use standard constructs when poss

Re: find help about 'read' built-in command

2007-11-13 Thread Mike Stroyan
On Wed, Nov 14, 2007 at 03:33:25PM +0800, Tatavarty Kalyan wrote: > if you use "$PWD" variable the assignment seems redundant too:) Assigning the value of "$PWD" can be useful for remembering a directory before using cd to change the directory. That leads into the next question about directory t

Re: find help about 'read' built-in command

2007-11-13 Thread Tatavarty Kalyan
if you use "$PWD" variable the assignment seems redundant too:) On 11/14/07, Mike Stroyan <[EMAIL PROTECTED]> wrote: > > On Wed, Nov 14, 2007 at 01:11:12PM +0800, 龙海涛 wrote: > > it works. > > 3x very much. > > > > On Tue, 2007-11-13 at 21:51 -0700, Bob Proulx wrote: > > > > > 龙海涛 wrote: > > > > i

Re: find help about 'read' built-in command

2007-11-13 Thread Mike Stroyan
On Wed, Nov 14, 2007 at 01:11:12PM +0800, 龙海涛 wrote: > it works. > 3x very much. > > On Tue, 2007-11-13 at 21:51 -0700, Bob Proulx wrote: > > > 龙海涛 wrote: > > > i want to store the current working dir to a variable, i write > > > > The most common way to save the present working directory to a >

Re: find help about 'read' built-in command

2007-11-13 Thread 龙海涛
it works. 3x very much. On Tue, 2007-11-13 at 21:51 -0700, Bob Proulx wrote: > 龙海涛 wrote: > > i want to store the current working dir to a variable, i write > > The most common way to save the present working directory to a > variable would be to use the $(...) form. > > test=$(pwd) > echo

Re: find help about 'read' built-in command

2007-11-13 Thread Bob Proulx
龙海涛 wrote: > i want to store the current working dir to a variable, i write The most common way to save the present working directory to a variable would be to use the $(...) form. test=$(pwd) echo $test Try that. Bob

find help about 'read' built-in command

2007-11-13 Thread 龙海涛
sorry for my simple problem. i want to store the current working dir to a variable, i write --- pwd | read test --- and i test the variable: --- echo $test --- but the $test is empty. did i make any stupid mistake? 3x for your atten