| UNIX/Linux Forum Archives · Rules and Guidelines · Disclaimer |
Help
Search
Members
Calendar
|
| Welcome Guest ( Log In | Register ) | Resend Validation Email |
![]() ![]() ![]() |
| bozzuul |
Posted: May 6 2005, 08:38 PM
|
|
Newbie ![]() Group: Members Posts: 2 Member No.: 978 Joined: 6-May 05 |
How do I make an csh script with a command as variable.
example: the programm name is hp in the prompt i type hp 12345 now there must be a new directory 12345 in folder /home/user with the mkdir command. 12345 is the variable. The programm must work on each number of 5 digits. regards, bozzuul |
| bozzuul |
|
|
Newbie ![]() Group: Members Posts: 2 Member No.: 978 Joined: 6-May 05 |
#!/bin/sh
cd /home/jan mkdir $1 |
| andyb1ack |
Posted: May 10 2005, 04:24 PM
|
||
|
User Level: 4 ![]() ![]() ![]() ![]() Group: Members Posts: 98 Member No.: 513 Joined: 9-September 04 |
Hi bozzul, Bit dangerous. what if /home/jan doesn't exist? It'll create your directory where-ever you happen to be. You can check the directory is there in the korn shell with:
|
||
![]() |
![]() ![]() ![]() |