Develop a simple command line parser


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Develop a simple command line parser
# 1  
Old 08-23-2012
Error Develop a simple command line parser

I want to develop a simple command line parser so that then I can print the values of different options :tions.

-analyze
-filename<fileName>

Via man pages I got to know getopt command would be used.

Buut how to use it.. how to encrypt this in a perl script..

grateful if u could help
# 2  
Old 08-23-2012
What do you mean by 'encrypt'? What are you trying to do? Your question is too vague to give specific answers to.
# 3  
Old 08-23-2012
The getopts you describe is useful for shell scripts. If you want perl solution, you need to read perl documents.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed command to replace a line at a specific line number with some other line

my requirement is, consider a file output cat output blah sdjfhjkd jsdfhjksdh sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf hellow there this doesnt look good et cetc etc etcetera i want to replace a line of line number 4 ("this doesnt look good") with some other line ... (3 Replies)
Discussion started by: vivek d r
3 Replies

2. UNIX for Dummies Questions & Answers

Help with awk (making simple/advanced ini parser)

Hello I'm searching some kind of example (or ready-made solution, but I don't really want it, because I want to learn awk more), to make something like a parser in awk for something like this (I put example, because I don't really know how to explain this): line1=1 line2=0 line3=1... (23 Replies)
Discussion started by: jormung
23 Replies

3. Shell Programming and Scripting

simple php/expect script works from command line but not from web

I have a really basic expect script which I call from php. I works fine when I run the php from the shell, but from the web it appears as if the output buffer gets chopped and never gets all of the contents. php script: (runexpect.php) <?php... (7 Replies)
Discussion started by: jacksona2
7 Replies

4. Infrastructure Monitoring

How to concatenate this simple line in Unix?

Hi: I use the snmpget command everyday. And Im getting tire of writing the same line evertime I have to verify something. Example of the line: snmpget -c DreamTeam dal2-hr2 ifAlias.227 The .227 its the circuit interface and also its variable; could be any other number depending on the... (13 Replies)
Discussion started by: javygonx
13 Replies

5. Shell Programming and Scripting

awk command for simple join command but based on 2 columns

input1 a_a a/a 10 100 a1 a_a 20 200 b1 b_b 30 300 input2 a_a a/a xxx yyy a1 a1 lll ppp b1 b_b kkk ooo output a_a a/a 10 100 xxx yyy (2 Replies)
Discussion started by: ruby_sgp
2 Replies

6. UNIX for Dummies Questions & Answers

Sending a simple mail from command line

Hi, How would one send an email from the command line. Just a simple email. I used mailx -s "test" address@server.domain then hit enter. Nothing happens then, I hit Ctrl + C twice, then I can start a new command again. Any help? Tips? I did read up on this, but the examples is much more... (2 Replies)
Discussion started by: McGuywer
2 Replies

7. Shell Programming and Scripting

perl 09-06-11 to 11062009, simple one line

Hi Guys, If want to change the string "09-06-11" to "11062009", i can only think use split to get the array@, the ,,, then restructure the sequence. Is there a simple line to do that? :o Thanks -----Post Update----- @file_e_tmp = split('-', $ARGV); $file_date_e =... (6 Replies)
Discussion started by: jimmy_y
6 Replies

8. Shell Programming and Scripting

Capture two set of data to same line...simple

I would like to capture output from two commands to a test file on the same line... I want to get a file with all Applications and the Version of it...here are the two commands I use to get the output. To get Application list I use ls -1 /Applications/ |grep .app >>... (3 Replies)
Discussion started by: elbombillo
3 Replies

9. UNIX for Dummies Questions & Answers

How to develop C program using UNIX command

hai friend, I am new to linux... I have to develop C program using unix command and i know the SYSTEM command.. But i need other then SYSTEM comand, plz send me the sample code.... Thank you.. sundar (1 Reply)
Discussion started by: sundar.lsr
1 Replies

10. Programming

command line parser

hey peeps i need to allow a user to input a line and then my job is to separate that line into tokens and print out what each command is. my question here is, if eg: 'ls > aifle' is entered as the input line, you would separate it and get three tokens: token 1 would be 'ls', token 2 '>' and... (0 Replies)
Discussion started by: mile1982
0 Replies
Login or Register to Ask a Question