LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Create custom user's directory with simple script (https://www.linuxquestions.org/questions/programming-9/create-custom-users-directory-with-simple-script-228481/)

dtournas 09-09-2004 03:24 AM

Create custom user's directory with simple script
 
Hi forum,

I need to write a simple script that runs a few commands in an order. Let's just say that this sth like a cmd file:

./cmd [var]

In the var section I want to add a username which automatically creates a directory somewhere. The fisrt attempt was sth like this:

Code:

mkdir /ntprofiles/%u
hoping that the %u var will be replaced with the username.... Ofcourse, that didn't work...

Any hints?

Hko 09-09-2004 04:37 AM

Close. This would have done it:
Code:

mkdir /ntprofiles/$1

dtournas 09-09-2004 05:00 AM

That was close really! Thank you very much!;)


All times are GMT -5. The time now is 10:15 PM.