Thread: Implementing cd command to a microshell

  1. #1
    Registered User
    Join Date
    Jan 2020
    Posts
    1

    Implementing cd command to a microshell

    Hi, I have to write a microshell for my class at university, and I have a really big problem with making a cd command work.
    I basically don't have anything to show you, because every way I tried it just doesn't work.
    I want something like this - cd \Desktop - work.
    I know I have to split the string into at least two, but I have no idea what else to do with it. My best shot was at using switch, but chdir did not work with it at all.
    Help please?

  2. #2
    Registered User
    Join Date
    Dec 2017
    Posts
    1,628
    How can we possibly tell you what you did wrong if you show no code?
    Why does Desktop have a windows-style backslash before it instead of the *nix-style forward slash?
    What do you mean "split the string into at least two"?
    Why would you use a switch?
    Nothing about your question makes sense.
    A little inaccuracy saves tons of explanation. - H.H. Munro

  3. #3
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    338
    Last edited by Structure; 01-15-2020 at 10:47 AM.
    "without goto we would be wtf'd"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 12
    Last Post: 05-15-2017, 07:24 AM
  2. Replies: 6
    Last Post: 08-08-2015, 04:12 AM
  3. Command line how to handle optional command.
    By ovid in forum C++ Programming
    Replies: 1
    Last Post: 03-07-2010, 11:41 PM
  4. Implementing CGI
    By peradox in forum Networking/Device Communication
    Replies: 4
    Last Post: 08-03-2005, 01:41 PM

Tags for this Thread