which is supposed to tell you what actual command will be executed if you type it in.
So if the name is listed by alias then there is an alias mapping which is run instead of looking for the command in the $PATH. Presumeably you are supposed to print out that mapping?
It goes upto "You asked for an alias" and quits... alia is a "char alia[1024];" definition and fp is a file pointer... Am I doing something wrong?
Edit: It outputs the data if I use something else other than alias. For example, something like netstat. I'm getting some error when I try to directly put something like alias ls. It says:
sh: line 1: alias: ls: not found
Last edited by Legend986; 09-30-2007 at 08:33 PM..
sh and bash do not produce any outputs whereas the others produce. The alias command works if I type it outside the program but "which alias" says it cannot find the command.