homepage Welcome to WebmasterWorld Guest from 54.166.173.147
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Linux shell scripting, simple but ...?
how to assign variable with a specific path
vina_melody




msg:906950
 1:03 pm on Nov 6, 2004 (gmt 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...

Thanks

 

uncle_bob




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

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

[tldp.org...]

freeflight2




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

or better: start learning perl

quebrada




msg:906953
 2:00 am on Nov 9, 2004 (gmt 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

Q

bakedjake




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

perl

Overkill for many common tasks.

MidwestMerchant




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

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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved