Click to See Complete Forum and Search --> : beginner question about shell scripting


CyberOsc
01-24-2001, 12:44 AM
I use bash shell on my Linux box.
I just learned about the shell scripting.

I tried to make a script that will go like this :

If a user run this script, it will change directory / cd to their home directory then it will make two directories under user's home directory :
public_html
myhomedir for example

The my question is how to execute cd(change directory) command in a script ??

I've tried with many ways but I still didn't get it.

Anybody please help me ...

Thanks in advance


------------------
** It's the world of Oscario **

pdc
01-24-2001, 02:46 AM
You should be able to place in your script:

cd ~

and cd to the home directory of the executing user.

Paul

[This message has been edited by pdc (edited 24 January 2001).]

YaRness
01-24-2001, 09:29 AM
you can just type in commands in a bash script the same as you would on the command line. so just list the commands as you would if you were typing them in:

cd ~
mkdir whatever
mkdir whateverelse
#etc.

------------------
"Assembly of Japanese bicycle require great peace of mind."
Registered Linux User #188285 http://counter.li.org/

CyberOsc
01-25-2001, 08:02 AM
Yap, that's work !!

Thanks alot !!

See ya !

------------------
** It's the world of Oscario **