Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

command line arguments

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 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 Linux
Sponsored Links
    #2  
Old Unix and Linux 03-11-2011
joeyg's Unix or Linux Image
joeyg joeyg is offline Forum Staff  
modérateur
 
Join Date: Dec 2007
Last Activity: 22 June 2015, 10:58 AM EDT
Location: Within two miles of a Dunkin donuts.
Posts: 2,356
Thanks: 85
Thanked 163 Times in 149 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 Unix and Linux 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 Linux
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux 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 01:03 PM.