The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
doubt in /etc/inittab script esham Shell Programming and Scripting 3 04-17-2009 01:38 PM
colors in BASH, doubt with script jaduks Shell Programming and Scripting 4 11-19-2007 05:21 AM
Shell scripting basic doubt sendhilmani123 Shell Programming and Scripting 3 08-04-2006 07:07 AM
shell / awk doubt krishna UNIX for Advanced & Expert Users 7 01-25-2002 01:09 PM
Unix + oracle doubt....involving shell script mexx_freedom UNIX for Dummies Questions & Answers 2 08-02-2001 10:48 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-05-2007
ravi raj kumar ravi raj kumar is offline
Registered User
  
 

Join Date: Dec 2006
Location: hyderabad
Posts: 102
shell script doubt

Hi,
While reading a shell script ,i have come accross the following statements.

script_name_full=$0
***script_name=${script_name_full##*\}
***script_name_noexst=${script_name%%\.ksh}
host_name=`hostname`
***host_name_short=${host_name%%\.*}
can anybody tell me what is the purpose of marked statements(2,3,5).
cheers
RRK
  #2 (permalink)  
Old 12-05-2007
LAKSHMI NARAYAN LAKSHMI NARAYAN is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 38
hi

the line in your script are commented, so no use of that lines in your script
  #3 (permalink)  
Old 12-05-2007
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Look under Parameter Expansion in man bash.
  #4 (permalink)  
Old 12-05-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by LAKSHMI NARAYAN View Post
the line in your script are commented, so no use of that lines in your script
A "*" is a comment in a shell script?
  #5 (permalink)  
Old 12-05-2007
ravi raj kumar ravi raj kumar is offline
Registered User
  
 

Join Date: Dec 2006
Location: hyderabad
Posts: 102
No,The are not comments .I put them foe identification.
Here is the actual script.

script_name_full=$0
script_name=${script_name_full##*\}
script_name_noexst=${script_name%%\.ksh}
host_name=`hostname`
host_name_short=${host_name%%\.*}

cheers
RRK
  #6 (permalink)  
Old 12-05-2007
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Quote:
Originally Posted by ravi raj kumar View Post
No,The are not comments .I put them foe identification.
Here is the actual script.

script_name_full=$0
script_name=${script_name_full##*\}
script_name_noexst=${script_name%%\.ksh}
host_name=`hostname`
host_name_short=${host_name%%\.*}

cheers
RRK
So have you looked up Parameter Expansion in man bash ?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0