Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. need help with unix commands

need help with unix commands

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorial
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 13942090
    wrote on last edited by
    #1

    Write a program that will provide help with basic unix commands. The program should contain a loop that asks the user to input a unix command or enter quit to stop the program. Your program should recognize at least 6 of the basic unix commands like pwd, etc.). Your program should print out the brief description of the command the user entered. If the user enters a command that your program does not recognize, then print a message to that effect.

    You must use the C++ string data type for your input variable.
    Hint: use the unix man command to get the brief description for the commands you plan to put in your program. The brief description is the text that appears in the NAME section of the man page, after the command name followed by two hyphens (–). For example:

    NAME
    pwd -- return working directory name

    P L 2 Replies Last reply
    0
    • U User 13942090

      Write a program that will provide help with basic unix commands. The program should contain a loop that asks the user to input a unix command or enter quit to stop the program. Your program should recognize at least 6 of the basic unix commands like pwd, etc.). Your program should print out the brief description of the command the user entered. If the user enters a command that your program does not recognize, then print a message to that effect.

      You must use the C++ string data type for your input variable.
      Hint: use the unix man command to get the brief description for the commands you plan to put in your program. The brief description is the text that appears in the NAME section of the man page, after the command name followed by two hyphens (–). For example:

      NAME
      pwd -- return working directory name

      P Offline
      P Offline
      Peter_in_2780
      wrote on last edited by
      #2

      No, we don't do your homework. If you've made an honest attempt and are stuck on some detail, come back, show us your code and ask a specific question.

      Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

      1 Reply Last reply
      0
      • U User 13942090

        Write a program that will provide help with basic unix commands. The program should contain a loop that asks the user to input a unix command or enter quit to stop the program. Your program should recognize at least 6 of the basic unix commands like pwd, etc.). Your program should print out the brief description of the command the user entered. If the user enters a command that your program does not recognize, then print a message to that effect.

        You must use the C++ string data type for your input variable.
        Hint: use the unix man command to get the brief description for the commands you plan to put in your program. The brief description is the text that appears in the NAME section of the man page, after the command name followed by two hyphens (–). For example:

        NAME
        pwd -- return working directory name

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Start with the basics and build on it gradually. The first thing you need is a program that accepts a string from the user and checks to see if is the word "quit". If it is anything else then print "unknown command" and go back and wait for the next input. If it is "quit" then exit the program. Once you have that working you can add the other commands one at a time, testing the program after each one.

        D 1 Reply Last reply
        0
        • L Lost User

          Start with the basics and build on it gradually. The first thing you need is a program that accepts a string from the user and checks to see if is the word "quit". If it is anything else then print "unknown command" and go back and wait for the next input. If it is "quit" then exit the program. Once you have that working you can add the other commands one at a time, testing the program after each one.

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Something is definitely wrong here. This is the most simplest, succinct explanation that could be offered, so why in the crap is it not being taught/understood in the school system? Is it the students or the instructors that are to blame?

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

          J L 2 Replies Last reply
          0
          • D David Crow

            Something is definitely wrong here. This is the most simplest, succinct explanation that could be offered, so why in the crap is it not being taught/understood in the school system? Is it the students or the instructors that are to blame?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

            J Offline
            J Offline
            jeron1
            wrote on last edited by
            #5

            Well said.

            "the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle

            1 Reply Last reply
            0
            • D David Crow

              Something is definitely wrong here. This is the most simplest, succinct explanation that could be offered, so why in the crap is it not being taught/understood in the school system? Is it the students or the instructors that are to blame?

              "One man's wage rise is another man's price increase." - Harold Wilson

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I suspect it's a mixture. Some teachers are not so good, some students lack the ability, some are lazy. But I suspect we never hear from the ones who do have good teachers, and ability, and are prepared to try things for themselves.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups