Results 1 to 4 of 4
i want to user system call on linux . include ">" and ">>" and "|"
example command
cat /etc/sysconfig/network | grep GATEWAY | cut -d= -f2
or
arp -en | ...
- 11-30-2008 #1Just Joined!
- Join Date
- Jun 2007
- Posts
- 84
how to user system call in C Programing
i want to user system call on linux . include ">" and ">>" and "|"
example command
cat /etc/sysconfig/network | grep GATEWAY | cut -d= -f2
or
arp -en | grep $1 | awk '{print $3}' > test.txt
** $1 user input same shell scripts such as 172.168.1.1
or
how to programing this command in c programing
(not shell script)
- 11-30-2008 #2Code:
man 3 system
--
Bill
Old age and treachery will overcome youth and skill.
- 12-07-2008 #3Linux User
- Join Date
- Mar 2008
- Posts
- 287
Bill has it correct. Note bottom of that page.
From my dim recollection, I recall having a problem with piping commands.
If you do then examine "exec" as system(exec(urbashcommand)) I think that was what I had to do but it was several years ago.
- 12-07-2008 #4The system() library call handles piping.From my dim recollection, I recall having a problem with piping commands.--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote