On Sat, Aug 12, 2006 at 01:51:12AM -0600, Bob Proulx wrote:
> Stephane Chazelas wrote:
> > [ -e "$cmd" ] || cmd=$(command -v -- "$cmd") || exit
> > Bob Proulx wrote:
> > > Of course using command as you have done will work for bash.
> >
> > "command" is a POSIX command. So will work with every P
[EMAIL PROTECTED] (Bob Proulx) writes:
>> 2- word splitting when IFS contains non-blank characters varies
>> from one shell to the next, and in most implementations
>> (including bash and AT&T ksh, it differs from the way the shell
>> splits $PATH internally to look up a command ("/bin:" is "/bin"
Stephane Chazelas wrote:
> [ -e "$cmd" ] || cmd=$(command -v -- "$cmd") || exit
> Bob Proulx wrote:
> > Of course using command as you have done will work for bash.
>
> "command" is a POSIX command. So will work with every POSIX and
> therefore every Unix conformant sh.
That is not strictly tru
On Thu, Jul 13, 2006 at 11:53:00PM -0600, Bob Proulx wrote:
> Stephane Chazelas wrote:
> > $0 will always contain the file path, unless the script was
> > started as:
> >
> > bash script.sh
> >
> > And there's no script.sh in the current directory (in which case
> > sh/bash will have looked up scr
Stephane Chazelas wrote:
> $0 will always contain the file path, unless the script was
> started as:
>
> bash script.sh
>
> And there's no script.sh in the current directory (in which case
> sh/bash will have looked up script.sh in $PATH).
Of course using command as you have done will work for ba
Hi,
On 7/12/06, Stephane Chazelas <[EMAIL PROTECTED]> wrote:
On Tue, Jul 11, 2006 at 08:19:34PM -0400, Dave Rutherford wrote:
> On 7/11/06, Cai Qian <[EMAIL PROTECTED]> wrote:
> >I want its full pathname using 'dirname', but it will give me
> >unexpected result on some Linux or Bash versions.
>
On Tue, Jul 11, 2006 at 08:19:34PM -0400, Dave Rutherford wrote:
> On 7/11/06, Cai Qian <[EMAIL PROTECTED]> wrote:
> >I want its full pathname using 'dirname', but it will give me
> >unexpected result on some Linux or Bash versions.
>
> Well, 'dirname' certainly won't do what you want, but I'm sor
On 7/11/06, Cai Qian <[EMAIL PROTECTED]> wrote:
I want its full pathname using 'dirname', but it will give me
unexpected result on some Linux or Bash versions.
Well, 'dirname' certainly won't do what you want, but I'm sorry,
I can't think of a way to get what you need. (It would be relatively
Hi,
I want its full pathname using 'dirname', but it will give me
unexpected result on some Linux or Bash versions.
Qian
On 7/11/06, Dave Rutherford <[EMAIL PROTECTED]> wrote:
On 7/11/06, Cai Qian <[EMAIL PROTECTED]> wrote:
> In some Linux, it will print "/tmp/script.sh", while in other, it wi
On 7/11/06, Cai Qian <[EMAIL PROTECTED]> wrote:
In some Linux, it will print "/tmp/script.sh", while in other, it will
print "script.sh" only. Which is wrong? If both are fine, is there any
better way to make it portable?
Which do you want? (Both are fine.) If you want 'script.sh',
use 'basen
Hi,
What is the expected result of the following script?
#! /bin/bash -
export PATH=/tmp/
echo $0
exit 0
Then, put this file to /tmp/.
cd / and run
PATH=/tmp/ script.sh
In some Linux, it will print "/tmp/script.sh", while in other, it will
print "script.sh" only. Which is wrong? If both are
11 matches
Mail list logo