On Mon, 11 Nov 2002, Michael Schwendt wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> On Mon, 11 Nov 2002 08:55:41 +0100, Ronald Hermans wrote:
>
> > I wrote a little script to change to an other directory:
> >
> > #!/bin/bash
> > cd /home/ronald/scripts
> > clear
> >
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Mon, 11 Nov 2002 08:55:41 +0100, Ronald Hermans wrote:
> I wrote a little script to change to an other directory:
>
> #!/bin/bash
> cd /home/ronald/scripts
> clear
> ls -l *.sh
>
> Everything goes allright except the fact
Title: RE: Bash question
Ur script is executed in a new child bash shell. And the child exits as the script ends.
Execute it like this (with out double quotes)
". Yourscript"
-Original Message-
From: Ronald Hermans [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 11, 200
Thanks again to everyone for all the constructive answers received.
Best regards
Gustav
Gustav Schaffter wrote:
>
> Hi,
>
> In a bash script I can look at $0 to find the name of the current script
> file, but if it's started with a full path, I will find the full path
> and filename in $0.
>
use like this:
echo Usage: `basename $0` [options]
> -Original Message-
> From: Gustav Schaffter [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 21, 2000 12:42 PM
> To: redhat-list (Mailing list)
> Subject: bash question
>
>
> Hi,
>
> In a bash script I can look at $0 to find the na
As this is a bash question and not a Bourne shell question, I'd like to
offer A Better Way.
Instead of referring to $0, just use ${0##*/}
Typically, the start of most bash or ksh scripts will say:
prog=${0##*/}
Then later on refer to ${prog}
--
-Time flies like the wind. Fruit flies like a b
At 09:41 PM 4/21/00 +0200, you wrote:
>Hi,
>
>In a bash script I can look at $0 to find the name of the current script
>file, but if it's started with a full path, I will find the full path
>and filename in $0.
>
>How can I find only the name of the script file even if it's started
>with the full