command line arguments | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


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

command line arguments

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 03-11-2011
vins_89 vins_89 is offline
Registered User
 
Join Date: Mar 2011
Last Activity: 13 March 2011, 3:15 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
command line arguments

hi,,,,

I want to create a command prompt, for example "prompt>", so my prompt need to handle commands, for example "prompt>cmd", so i want to know how to get arguments for my own commands cmd, i.e. default argc should contain arguments count and argv should point to the argument vector i.e, for example "prompt>cmd arg1 arg2" now argc should contain 2 n argv should point to arguments,,,so wats may be the solution for this????

thanks in advance for the solution
Sponsored Links
    #2  
Old 03-11-2011
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
 
Join Date: Dec 2007
Last Activity: 18 April 2014, 8:44 AM EDT
Location: Out running a Marathon.
Posts: 2,308
Thanks: 66
Thanked 150 Times in 140 Posts
Are you expecting the user to type the prompt> or do you want that to automatically appear on the screen? To have it automatically appear, review the PS1 parameter.
For your cmd - you will need to make that cmd into a script. The script would then handle your arguments.
Sponsored Links
    #3  
Old 03-13-2011
vins_89 vins_89 is offline
Registered User
 
Join Date: Mar 2011
Last Activity: 13 March 2011, 3:15 AM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
thanks
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
command line arguments ikeQ UNIX for Dummies Questions & Answers 1 05-20-2010 03:32 AM
command line arguments skooly5 Shell Programming and Scripting 1 04-07-2008 03:49 AM
arguments in command line rrs UNIX for Dummies Questions & Answers 6 07-28-2006 06:44 AM
command line arguments bankpro Programming 3 02-02-2006 10:12 AM
Command Line Arguments roba909 UNIX for Dummies Questions & Answers 7 01-19-2006 12:46 PM



All times are GMT -4. The time now is 07:28 PM.