Welcome to WebmasterWorld Guest from 54.167.153.63

Forum Moderators: bakedjake

Message Too Old, No Replies

Linux shell scripting, simple but ...?

how to assign variable with a specific path

   
1:03 pm on Nov 6, 2004 (gmt 0)

10+ Year Member



How to assign variable in shell scripting (i'm using vi in Mandrake) with a specific path based on user input?

For example :
The user input is /home/alex

and then i want to assign it to var link...

Thanks

1:23 pm on Nov 6, 2004 (gmt 0)

10+ Year Member



I'd recommend reading the bash scripting guide, as it will answer you questions better than I can

[tldp.org...]

3:14 am on Nov 8, 2004 (gmt 0)

10+ Year Member



or better: start learning perl
2:00 am on Nov 9, 2004 (gmt 0)

10+ Year Member



I agree with the Perl comment, but we don't always decide the language we use.

$home for the users home path

$user for the user

Q

10:12 pm on Nov 9, 2004 (gmt 0)

WebmasterWorld Administrator bakedjake is a WebmasterWorld Top Contributor of All Time 10+ Year Member



perl

Overkill for many common tasks.

9:55 am on Nov 14, 2004 (gmt 0)

10+ Year Member



not 100% sure if this is right..but maybe:

${VariableName} == "User input"
PATH=:/home/alex/$VariableName

 

Featured Threads

Hot Threads This Week

Hot Threads This Month