hifza
October 26th, 2009, 04:00 PM
im completely new to linux. i hav the following task to complete. i managed to do this by adding aliases to the .bashrc file and by changng the PS format from there. but the teacher wants it all to be done in the form of a c code. plz help. i'm not looking for someone to solve the whole thing for me.
isn't there a way i could add the same aliases into a new bash script and call it from within the c code and still have these functions implemented?
TASK:
When the process starts, a prompt of following format should appear on the Terminal/Konsole:
[time] user@host: working_dir $
e.g., [12:34] ali@myPC: /home/ali $
Students are required to implement three possible operations. These include
When the user enters “list”, a listing of all the contents of the working directory should be displayed (similar to the 'ls' program in Linux)
When the user enters “create file_name content”, the process should
Create a file called file_name in the current directory
Write the string “content” into the newly created file
The process should terminate/end when the user enters "quit"
isn't there a way i could add the same aliases into a new bash script and call it from within the c code and still have these functions implemented?
TASK:
When the process starts, a prompt of following format should appear on the Terminal/Konsole:
[time] user@host: working_dir $
e.g., [12:34] ali@myPC: /home/ali $
Students are required to implement three possible operations. These include
When the user enters “list”, a listing of all the contents of the working directory should be displayed (similar to the 'ls' program in Linux)
When the user enters “create file_name content”, the process should
Create a file called file_name in the current directory
Write the string “content” into the newly created file
The process should terminate/end when the user enters "quit"