Announcement

Collapse
No announcement yet.

fun with homework...shell commands! (IE PLEASE HELP)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • fun with homework...shell commands! (IE PLEASE HELP)

    we are working with shell scripts, in particular a reworking of setpath...

    I need to change this:

    if [ -z $PATH ]; then
    PATH=$newpath
    elif [ $PATH="." ] || [ $PATH = ".." ]; then
    PATH=$newpath:.
    elif [ $PATH=":" ]; then
    PATH=$newpath:
    elif [ ${PATH:${#PATH}-2} = ":." ]; then
    PATH={PATH/%":."/:$newpath:.}
    elif [ ${PATH:${#PATH}-1} = ":" ]; then
    PATH=${PATH/%":"/:newpath:.}
    else
    PATH=$PATH:$newpath
    fi

    into a loop....

    can anyone help???
    "Mal nommer les choses, c'est accroître le malheur du monde" - Camus (thanks Davout)

    "I thought you must be dead ..." he said simply. "So did I for a while," said Ford, "and then I decided I was a lemon for a couple of weeks. A kept myself amused all that time jumping in and out of a gin and tonic."

  • #2
    Use Perl .
    This is Shireroth, and Giant Squid will brutally murder me if I ever remove this link from my signature | In the end it won't be love that saves us, it will be mathematics | So many people have this concept of God the Avenger. I see God as the ultimate sense of humor -- SlowwHand

    Comment


    • #3
      ha, unfortunately, that isn't an option, i'm stuck with using the bash shell
      "Mal nommer les choses, c'est accroître le malheur du monde" - Camus (thanks Davout)

      "I thought you must be dead ..." he said simply. "So did I for a while," said Ford, "and then I decided I was a lemon for a couple of weeks. A kept myself amused all that time jumping in and out of a gin and tonic."

      Comment


      • #4
        okay, so maybe a loop isn't necessary, i just need to simplify it....anyone???
        "Mal nommer les choses, c'est accroître le malheur du monde" - Camus (thanks Davout)

        "I thought you must be dead ..." he said simply. "So did I for a while," said Ford, "and then I decided I was a lemon for a couple of weeks. A kept myself amused all that time jumping in and out of a gin and tonic."

        Comment


        • #5
          Nooooooo idea.

          Why not just give up and post some shirtless pics?

          Comment


          • #6


            You got a problem there... I agree with Red Jon.

            Just Bash the SHell... haha, see, that's punny.
            Monkey!!!

            Comment


            • #7
              SHIRTLESS PIC(S)! SHIRTLESS PIC(S)!

              Comment


              • #8
                take a cold shower rj
                "The Christian way has not been tried and found wanting, it has been found to be hard and left untried" - GK Chesterton.

                "The most obvious predicition about the future is that it will be mostly like the past" - Alain de Botton

                Comment


                • #9
                  Ugh, I miss my uni boyfriend.

                  Btw, Cockney did you ever wanna meet?

                  Comment


                  • #10
                    yeah man, just never quite got round to it (if you ever get to know me you'll understand ). i think you sent me your number but i think i deleted the pm (was prolly hungover and not really concentrating ). i'm sure we could sort something out next term.
                    "The Christian way has not been tried and found wanting, it has been found to be hard and left untried" - GK Chesterton.

                    "The most obvious predicition about the future is that it will be mostly like the past" - Alain de Botton

                    Comment


                    • #11
                      Sure, sounds cool. And is it that you have a heavy social schedule or you're just disorganised?

                      Comment


                      • #12
                        a little from column a and a little from column b

                        btw when do your exams finish?
                        "The Christian way has not been tried and found wanting, it has been found to be hard and left untried" - GK Chesterton.

                        "The most obvious predicition about the future is that it will be mostly like the past" - Alain de Botton

                        Comment


                        • #13
                          June 5th I think. What about you?

                          Comment


                          • #14
                            3rd, then 3 weeks of pure party, i am saving so much money for that
                            "The Christian way has not been tried and found wanting, it has been found to be hard and left untried" - GK Chesterton.

                            "The most obvious predicition about the future is that it will be mostly like the past" - Alain de Botton

                            Comment


                            • #15
                              Yeah, those are the 3 weeks I'm looking forward to. My bf's arranging a trip for us to Munich to interrupt it though. How selfish of him

                              Comment

                              Working...
                              X