Bash & Symbolic Links II

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

Bash & Symbolic Links II

#1 Post by RSH »

Hi,

i want to make symbolic links from existing files. Example

Directories:

workdir=/mnt/sdc3/workdir_temp

dir1=/usr/share/applications-desktop-files
dir2=/usr/share/applications

fullpath1=/$workdir/$dir1
fullpath2=/$workdir/$dir2

I want to make symbolic links from $dir1 to $dir2 inside the $workdir!

So, the target of symlink in $dir2 is $dir1 and NOT $workdir/$dir1

Any chance (how) to do this?

Thanks!

EDIT:

Code: Select all

cd $workdir

BNF=`basename "$file"`

ln -s "$dir1/$BNF" "$dir2/$BNF"
Did this and did work! :shock:

Could it be that easy???

NO!!! Did only work one time! :(

Need Help!!!
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#2 Post by technosaurus »

Code: Select all

cd PATH_TO/$dir2
ln ../$dir1/file_name .
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply