Aaahhh ok I get it now. The reason the above code works is because I had to set a up an alias for my program that piped the alias output to the program (just like which), then grep for the...
Type: Posts; User: lan_zer0
Aaahhh ok I get it now. The reason the above code works is because I had to set a up an alias for my program that piped the alias output to the program (just like which), then grep for the...
The code seems to work though. I took out STDIN_FILENO, and it seems to work ok. It hangs when i run it directly, but runs fine with a test suite.
Thanks, I'll try that.
I apologize, I should have explained the code a bit better. Command is the command I want to print the alias out for. So the code is the core of my printAlias function,...
Would you be able to explain the grep command above? I still don't understand how it is able to grab the alias and print it out. It looks like its doing something like grep -e [command]=, and...
Thanks for the replies. What I am trying to do is implement a limited 'which' command, one of the options being to display the alias of the input command. So the basic use of my which program would...
Hi, I was wondering how to execute Linux shell commands, like 'alias,' from a C program. I understand how to fork and use execl with commands like 'ls' and 'grep', but I cannot find the proper path...