What is ${0##*/}$$????

What is ${0##*/}$$????

Post by Adriano Prad » Thu, 07 Dec 2000 04:00:00



Hi there,

Where can i find some documentation about stuff like this: ${0##*/}$$ ?
...and what is it???

When I echo it in Korn shell it shows -ksh17006:
$ echo ${0##*/}$$
-ksh17006

Thanks!

--
Adriano Prado
_______________________

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

What is ${0##*/}$$????

Post by Glenn Wes » Thu, 07 Dec 2000 04:00:00




Quote:> Hi there,

> Where can i find some documentation about stuff like this: ${0##*/}
$$ ?
> ...and what is it???

> When I echo it in Korn shell it shows -ksh17006:
> $ echo ${0##*/}$$
> -ksh17006

> Thanks!

Page 106 of "Learning the Korn Shell"...

The 0 equates to the current command (in your case the login shell, -
ksh)

the ## means to match as much of $0 as possible and delete it

the */ is the pattern to match (combined with ##, it means we are
stripping off the directory portion of $0)

the $$ is the current shell's pid

HTH...

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

What is ${0##*/}$$????

Post by Derek M. Fly » Thu, 07 Dec 2000 04:00:00



> Where can i find some documentation about stuff like this: ${0##*/}$$ ?

Look at the manual page.

Quote:> ...and what is it???

${0##*/} looks at the script name and removes anything up to the first
"/".  $$ adds the scripts process id.  It sounds like something you would
do to create a unique temporary file name.
 
 
 

What is ${0##*/}$$????

Post by Kevin Mile » Thu, 07 Dec 2000 04:00:00



> Hi there,

> Where can i find some documentation about stuff like this: ${0##*/}$$ ?
> ...and what is it???

> When I echo it in Korn shell it shows -ksh17006:
> $ echo ${0##*/}$$
> -ksh17006

> Thanks!

> --
> Adriano Prado
> _______________________

> Sent via Deja.com http://www.deja.com/
> Before you buy.

the ${0##*/} displays the current shell you are running and $$ is the current
process of that shell
--
Kev
 
 
 

What is ${0##*/}$$????

Post by Kevin Mile » Thu, 07 Dec 2000 04:00:00




> > Hi there,

> > Where can i find some documentation about stuff like this: ${0##*/}$$ ?
> > ...and what is it???

> > When I echo it in Korn shell it shows -ksh17006:
> > $ echo ${0##*/}$$
> > -ksh17006

mind you this does the same and is simpler

echo $0$$

--
Kev

 
 
 

What is ${0##*/}$$????

Post by Dan Merc » Thu, 07 Dec 2000 04:00:00






>> > Hi there,

>> > Where can i find some documentation about stuff like this: ${0##*/}$$ ?
>> > ...and what is it???

>> > When I echo it in Korn shell it shows -ksh17006:
>> > $ echo ${0##*/}$$
>> > -ksh17006

> mind you this does the same and is simpler

> echo $0$$

No,  it doesn't.  Within a script, say /usr/local/bin/myscript,
${0##*/}$$ might produce myscript9999,  while $0$$ will produce
/usr/local/bin/myscript9999.  If you are using this string to
produce a temporary filename,  as is likely,  you are far more likely
to have success writing to myscript9999 than /usr/local/bin/myscript9999.

--
Dan Mercer

 
 
 

What is ${0##*/}$$????

Post by Roy » Sun, 10 Dec 2000 07:51:10




> On the glorious day of Wed, 06 Dec 2000 13:50:55 GMT, Adriano Prado

> >Hi there,

> >Where can i find some documentation about stuff like this: ${0##*/}$$ ?

man ksh

Regards
Roy

 
 
 

1. This clone thing...am I stupid, or am I right?


says...

I admire your passion, Chris..

The only issues which have kept myself from looking seriously at Linux
would be:

* It's Unix and the learning curve to start getting productive strikes me
as probably very steep

* It doesn't support plug-and-play.  If your hardware doesn't have Linux
drivers, it don't play..

* Not nearly the amount of developers out there doing stuff for Linux as
there are for Wintel.  Can I get MS Office for Linux?  Can I get
Photoshop for Linux?  Can I get QuarkXpress for Linux? etc.. a big turn
off for me.

--
Reuben King
Email: "reuben at texas dot net" (in plain english to foil spam-bots.
grrr!)

2. us-ca-sacramento-UNIX SYS ADMIN-SMP,MPP-(recruiter sd-lr)

3. Neither term116 nor term117 compiles on an SGI

4. I am with the following error, when i am running lilo...

5. PDF viewing? anyone?

6. Am I touchy? Or am I right?

7. RH 7.2, netscape and java problem

8. Am I seeing IPv5, or am I hallucinating?

9. I am buying an Ultra 5 but am lost in part numbers ....

10. I am in text mode, what browser am I running....

11. I am si**y am I?

12. Am I an idiot..... am I? Disk mount prob....