The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how can i print the output of the shell script in bigger size mail2sant Shell Programming and Scripting 2 04-14-2008 01:07 AM
shell script to print '*' triangle akash Shell Programming and Scripting 12 01-09-2008 08:18 PM
Shell script to search through numbers and print the output cdfd123 Shell Programming and Scripting 8 10-30-2007 12:40 PM
perl - why is the shell script executed before the print command? mjays Shell Programming and Scripting 3 09-21-2007 02:49 AM
A shell script question surjyap Shell Programming and Scripting 2 11-24-2005 01:48 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-23-2008
Registered User
 

Join Date: Mar 2007
Posts: 31
Linux Shell Question: how to print the shell script name ?

Suppose I have a script named "sc.sh"
in the script how to print out its name "sc.sh"?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-24-2008
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Code:
#!/bin/bash
echo "$( basename $0 )"
Cheers,
ZB
Reply With Quote
  #3 (permalink)  
Old 06-29-2008
Registered User
 

Join Date: Jan 2008
Posts: 5
echo $SHELL
Reply With Quote
  #4 (permalink)  
Old 07-01-2008
Registered User
 

Join Date: Jun 2008
Posts: 19
echo $0
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0