create multiple symbolic links [Solved]

If you are new to Linux or new to Sabayon Linux and just not sure where to post, here ya go. Post without fear of being told to RTFM :-)

Moderator: Moderators

create multiple symbolic links [Solved]

Postby E.M.G. » Tue Oct 20, 2009 0:51

I did another clean install of SL5K_64 and instead of re-using my separate /home partition, I instead mount it as a data drive. Now I have created symbolic links to the important folders and files and everything is good so far, but I'd like to be able to create a script that will create these links for me rather than having to type them in if/when I re-install (I like to tinker), but I don't have a clue as to how to write a script so any help would be great ...


Thanks
Last edited by E.M.G. on Tue Oct 20, 2009 22:01, edited 1 time in total.
E.M.G.
Simple Hen
 
Posts: 80
Joined: Tue Jun 24, 2008 18:50
Location: 42.44°N 73.11°W

Re: create multiple symbolic links

Postby xlnagla » Tue Oct 20, 2009 4:55

This might help out:

http://www.linuxconfig.org/Bash_scripting_Tutorial

If you have specific questions, feel free to ask away.

~xlnagla
xlnagla
Sagely Hen
 
Posts: 1078
Joined: Mon May 28, 2007 2:44

Re: create multiple symbolic links

Postby E.M.G. » Tue Oct 20, 2009 21:35

xlnagla wrote:This might help out:

http://www.linuxconfig.org/Bash_scripting_Tutorial

If you have specific questions, feel free to ask away.

~xlnagla


Thanks xlnagla ... this is just what I was looking for ...
E.M.G.
Simple Hen
 
Posts: 80
Joined: Tue Jun 24, 2008 18:50
Location: 42.44°N 73.11°W

Re: create multiple symbolic links

Postby E.M.G. » Tue Oct 20, 2009 21:53

ok ... this is the script I made and tried:

#!/bin/bash
#loop to make sym-links
for f in $( ls /me/ ): do
ln -s $f ~/pip/$f
done

I'm sure that both directories exist and that I have access to them ... the latter (pip) being a test dir in my home folder, once I get it to work I'll add the correct paths


and I get this error:
/linker.sh: line 4: syntax error near unexpected token `ln'
./linker.sh: line 4: ` ln -s $f ~/pip/$f'

I'm still reading but if I can get there a little faster would be great ... thanks
E.M.G.
Simple Hen
 
Posts: 80
Joined: Tue Jun 24, 2008 18:50
Location: 42.44°N 73.11°W

Re: create multiple symbolic links[SOLVED]

Postby E.M.G. » Tue Oct 20, 2009 22:00

Found my mistake ... thanks
E.M.G.
Simple Hen
 
Posts: 80
Joined: Tue Jun 24, 2008 18:50
Location: 42.44°N 73.11°W

Re: create multiple symbolic links[SOLVED]

Postby xlnagla » Tue Oct 20, 2009 23:11

semicolon?
xlnagla
Sagely Hen
 
Posts: 1078
Joined: Mon May 28, 2007 2:44

Re: create multiple symbolic links[SOLVED]

Postby E.M.G. » Wed Oct 21, 2009 0:25

yep
E.M.G.
Simple Hen
 
Posts: 80
Joined: Tue Jun 24, 2008 18:50
Location: 42.44°N 73.11°W


Return to Beginners|Newbies Area

Who is online

Users browsing this forum: gamjaevel and 2 guests