Welcome to WebmasterWorld Guest from

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)

New User

10+ Year Member

joined:Sept 25, 2004
votes: 0

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...


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

Full Member

10+ Year Member

joined:Dec 11, 2003
votes: 0

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


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

Preferred Member

10+ Year Member

joined:Nov 16, 2003
votes: 0

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

Junior Member

10+ Year Member

joined:May 28, 2003
votes: 0

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


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

Administrator from CA 

WebmasterWorld Administrator bakedjake is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Apr 8, 2003
votes: 61


Overkill for many common tasks.

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

Junior Member

10+ Year Member

joined:Nov 8, 2004
votes: 0

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

${VariableName} == "User input"


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members