LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-10-2007, 12:45 PM   #1
Sebouh
LQ Newbie
 
Registered: Apr 2007
Posts: 15

Rep: Reputation: 0
Exclamation Handling I/O redirections in my shell.


Hi all.
This is my first post here, and i need urgent help with a programming assignment.
I am working on an assignment which requires me to build a simple shell. My shell must handle simple commands with arguements and ones with piping and I/O redirection.
The problem is i have no idea how to implement this redirection.
To further explain, my program reads the user's input such as: "ls -1 > text.txt" and does what a normal shell does. The problem is redirecting one's output as an input and the reverse. I have to execute two of the commands by forking two children and execve-ing. Then i need to do the redirection thing.
I have no idea were to start. I suppose it has with piping? I'm not sure.

Thanks alot for your help!
 
Old 04-10-2007, 01:17 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,731
Blog Entries: 1

Rep: Reputation: 224Reputation: 224Reputation: 224
LQ rules forbid us doing your homework for you. Etiquette forbids you asking us to.

Start here --> http://tldp.org/LDP/abs/html/io-redirection.html
 
Old 04-10-2007, 01:31 PM   #3
Sebouh
LQ Newbie
 
Registered: Apr 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Arow
LQ rules forbid us doing your homework for you. Etiquette forbids you asking us to.

Start here --> http://tldp.org/LDP/abs/html/io-redirection.html
Ermm, I'm not asking you to do my homework for me. I'm asking for an advice on how to start.
The link you gave me is all bash code. I need to write my stuff in C.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
handling linux kernel crash using a shell script indu.a Programming 1 03-22-2007 06:43 AM
handling multiple files in shell scripts. wilsonsamm Linux - General 7 07-05-2006 06:36 PM
file handling shell script ankit_mcgill Programming 6 04-29-2006 12:32 AM
Shell Script.. Date format handling C-RAF. Programming 2 02-14-2006 08:34 AM
Need help w/ shell handling 3 commands/2 pipes sptchamp Programming 3 07-15-2004 09:37 PM


All times are GMT -5. The time now is 03:43 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration