LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-09-2004, 03:24 AM   #1
dtournas
Member
 
Registered: Aug 2003
Location: Charlotte, North Carolina
Distribution: Red Hat (and look-alike), SUSE (when drunk), Slackware (when mad)
Posts: 148

Rep: Reputation: 16
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?
 
Old 09-09-2004, 04:37 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Close. This would have done it:
Code:
mkdir /ntprofiles/$1
 
Old 09-09-2004, 05:00 AM   #3
dtournas
Member
 
Registered: Aug 2003
Location: Charlotte, North Carolina
Distribution: Red Hat (and look-alike), SUSE (when drunk), Slackware (when mad)
Posts: 148

Original Poster
Rep: Reputation: 16
That was close really! Thank you very much!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script or Simple App to Create HTML Table Populated With Images infidel Linux - Software 14 06-07-2005 01:08 AM
ow to create script change a user's password? passwd expects input from keyboard.. Arodef Linux - General 1 03-02-2005 10:40 PM
Run script during file copy or create in directory neranjana Linux - General 1 01-13-2004 06:57 AM
how to write a script to create a directory mgam Linux - Newbie 1 10-29-2003 12:08 PM
Looking for simple way to create scheduled emails from perl script kdowney Programming 1 10-17-2003 06:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration