The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
simple shell - how to get a parameter typed in a shell script cmitulescu Shell Programming and Scripting 4 01-09-2009 08:45 PM
passing parameter 4m shell script to a DB stored procedure hema2026 Shell Programming and Scripting 0 11-16-2007 06:55 AM
How to pass a parameter from one Shell-script to another Shell-script subodhbansal Shell Programming and Scripting 2 09-22-2007 05:19 AM
passing parameter from Shell-script to Sql-script subodhbansal Shell Programming and Scripting 0 09-21-2007 06:15 AM
parameter file for a shell script bryan Shell Programming and Scripting 2 02-25-2005 12:58 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-12-2005
jhmr7 jhmr7 is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 11
Shell script with input parameter

Can anyone help me how to write a shell script which accepts input parameter. My requirement is as follows:

I need to run a shell script with a input parameter, and inside the script i will create a file with this input parameter name.

Please help me out to create such a shell script.

Thanks.
  #2 (permalink)  
Old 07-13-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Try this.

Code:
#! /bin/sh

if [ $# -ne 0 ]; then
        echo "Param "$@" "
        touch $@
fi;
You have to make use of $@, $# and $1 et al to make further proper use of command line parameters passed to the script.

Vino
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 03:21 AM.


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