[thelist] OT Unix Commands

Daniel J. Cody djc at starkmedia.com
Wed Feb 7 19:04:31 CST 2001


Hi Salvatore -

The big difference here between a DOS batch file and a Unix script is 
that the DOS .bat will run as the same process that the user who's 
running it, whereas unix doesn't. I guess the best way to put it is this:

Say we have two cars, one is the Unix car and one is the DOS car. We 
tell them both to go two blocks(cd directory/directory2). The DOS car 
goes two blocks with you inside it while the Unix car drives itself 
there and won't take you unless you ask it to.

So the script you're writing is actually going to that directory.. but 
its just changing to that directory and not doing anything, so it 
doesn't look like its doing anything.. To prove to yourself that your 
file is getting there, try this script:

#!/bin/bash
cd directory/directory2; # use your real directories
touch this.file

Now if you look in directory/directory2 you'll see a file called 
'this.file' proving that your script does indeed work.

Hope that analogy wasn't too wack and makes some sense.. Feel free to 
ask if you have more questions or that doesn't make sense :)

.djc.

Salvatore Palmisano wrote:

> For a class Im taking thats using UNIX, Ive attempted to do this, but its
> not working:
> file named update.  Update contains:
> cd directory/directory2

> when typing update at the UNIX prompt, nothing happens.  No error message, 
> just the root directory as if I hadnt typed anything.





More information about the thelist mailing list