LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-04-2009, 01:46 PM   #1
ameenyousuf
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Rep: Reputation: 0
Question need help with prob in linux


hi
i'm totally new to linux so i dunno squat abt it...

here are my problems..
1) i am trying to create a command "list" similar to the "ls" statement in linux as in when user enters "list" the list of files in the current directory is displayed
2)second....when the user enters "create file_name" a new file is created having the name file name

i have to write a program in c++
what i want my program to do is to act as a virtual shell...i'll use switch statements or choices
ive already created the command prompt...here's how it looks

[20:28] ameen@ameen-laptop: /home/ameen/Desktop/os $

so if the user enters "list" after $ a list of files in the directory is displayed and so on
this is just part of what i have to do....i hope i'm able to clarify my problem.

thanks for helping.
ameen
 
Old 11-04-2009, 02:16 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.
 
Old 11-04-2009, 02:34 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Tell us more about the class, including what reference materials you are using.

Are you experienced in C++?

Is the assignment really about Linux or is it about learning C++?
 
Old 11-04-2009, 02:45 PM   #4
ameenyousuf
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 0
the task was about creating a virtual shell in linux....using either C, java or C++....i opted for c++ because i haven't studied C or java yet...i'm not experienced in prog. but not a beginner either.

im about to complete it....only one part left..ive made the list function..the filing part is left..ive mainly used previously answered questions from this website and from other forums...i started programming in linux yesterday so this is the main reason i was looking for outside help..thanks.
 
Old 11-04-2009, 02:48 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
OK---great!! Let us know if we can help on something specific
 
Old 11-04-2009, 03:57 PM   #6
ameenyousuf
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 0
im stuck on this last thing....

here it goes:
the user enters something eg:
[01:41] ameen@ameen-laptop: /home/ameen/Desktop/os $ create filename data

what im trying to do is that when the user enters the command, as i i've written above in bold letters, filename becomes the name of the file....string data becomes the content of the file...create is the key word
i was thinking of breaking a string into three as in string 1,2,3 and entering them one by one to the filename and content....

im open to suggestions
 
Old 11-04-2009, 03:59 PM   #7
ameenyousuf
LQ Newbie
 
Registered: Nov 2009
Posts: 12

Original Poster
Rep: Reputation: 0
one extra thing....any idea on how to install guest addons in ubuntu 9.04.....i'm running it through virtual box

thanks,
ameen
 
  


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
Subtitle prob + Keyboard/Mouse Prob 2Pacalypse Ubuntu 1 02-26-2007 03:49 PM
red hat 9, printer prob and connection prob lasttriptotulsa Linux - Newbie 4 01-17-2007 04:39 AM
linux prob farhank Linux - Software 2 09-26-2005 09:07 PM
XFree keyboard problem, Quake prob and half-life prob cradlebin Linux - Software 0 09-21-2003 07:57 AM
Man 9.0 printer ? hardware prob ? install prob romcgill Linux - Hardware 2 02-24-2003 05:54 AM


All times are GMT -5. The time now is 07:58 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration