Re: Calculating the target of a symlink

2010-06-19 Thread NiftyFedora Mitch
On Sat, Jun 19, 2010 at 7:05 PM, Patrick O'Callaghan wrote: > A script I'm writing needs to work out the target of a symbolic link, > i.e. given: > > $ touch foo > $ ln -s foo bar > > the function should print bar when given foo as a parameter. The manual > says "ls -L" should do this, but it does

Re: Calculating the target of a symlink

2010-06-19 Thread Patrick O'Callaghan
On Sat, 2010-06-19 at 22:34 -0400, Sam Varshavchik wrote: > > Have I misunderstood what "ls -L" does? > > Yes, you did. The description of the -L option reads: > >-L, --dereference > when showing file information for a symbolic link, show > informa- > tion for

Re: Calculating the target of a symlink

2010-06-19 Thread Cameron Simpson
On 19Jun2010 21:35, Patrick O'Callaghan wrote: | A script I'm writing needs to work out the target of a symbolic link, | i.e. given: | | $ touch foo | $ ln -s foo bar | | the function should print bar when given foo as a parameter. >From your examples below, you mean "print foo when given bar a

Re: Calculating the target of a symlink

2010-06-19 Thread JD
On 06/19/2010 07:05 PM, Patrick O'Callaghan was caught red-handed while writing:: > A script I'm writing needs to work out the target of a symbolic link, > i.e. given: > > $ touch foo > $ ln -s foo bar > > the function should print bar when given foo as a parameter. The manual > says "ls -L" sho

Re: Calculating the target of a symlink

2010-06-19 Thread Sam Varshavchik
Patrick O'Callaghan writes: A script I'm writing needs to work out the target of a symbolic link, i.e. given: $ touch foo $ ln -s foo bar the function should print bar when given foo as a parameter. The manual says "ls -L" should do this, but it doesn't seem to work: $ touch foo $ ln -s foo b

Re: Calculating the target of a symlink

2010-06-19 Thread Siddhesh Poyarekar
On Sun, Jun 20, 2010 at 7:35 AM, Patrick O'Callaghan wrote: > A script I'm writing needs to work out the target of a symbolic link, > i.e. given: > > $ touch foo > $ ln -s foo bar > > the function should print bar when given foo as a parameter. The manual > says "ls -L" should do this, but it does