Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

arguments from command line 1

Status
Not open for further replies.

Bangieff

Technical User
Feb 12, 2001
52
BG
Hi all
here I am again with my lame questions ;)
How may I get from command line special characters like <,>,;.... and have them like arguments for my program (main(int argc,char **argv))?

thanks
 

You need to prepose them with the escape
character '\';

For egs: myprog \< \> \*\? will read <.>,* and ? as
arguments for your program myprog.

abp :cool:
 
Yes that's clear to me
but I need some way to catch them without &quot;\&quot;. That's because my program allows users to execute some commands with root privilegies but a don't want someone to read my shadow and copy it to stdout for exapmle ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top