Saturday, July 18, 2009

Assignment 5 - Hint.

Something to keep in mind - when you're running a bash script by typing "bash " you are actually running the script in a *different* shell not your current one with the command prompt. You need to figure out how to run a script in the *current* shell.

The logic behind Assignment 5 is this:

'my_cd ' will do the following:
will 1st print out the current directory then the directory you are
going to change to, and then change directories to it.

useful commands:
'pwd' returns the current working directory
'cd' changes directory

You need to figure out how to read in an argument from the command
line, put that argument value into your script and then change
directories to the that value.

While also remembering to save the
current directory into a variable so you can go back to it using your
custom 'go_back' script. Then:

'go_back' will:
read the value of the global variable you saved the previous 'pwd' to
then change directories to it.

This can all be done stringing together
linux commands we've already come across

Good Luck! Contact me via email if you need some further hints.

No comments:

Post a Comment