Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Equivalent of ksh basename $0 2

Status
Not open for further replies.

cryptoadm

MIS
Nov 6, 2008
71
US
In Perl what is the equivalent of basename $0

For example:
# cat test.sh
Code:
#!/bin/ksh
prog=`basename $0`
echo $prog
returns:
test.sh
 
Code:
#!perl
use File::Basename;
my $prog = basename($0);
print "$prog\n";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top