Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: symlink destination
- To: tlug@example.com
- Subject: Re: symlink destination
- From: Viktor Pavlenko <vp@example.com>
- Date: Wed, 25 Oct 2000 16:36:56 +0900
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii
- In-Reply-To: <Pine.GSO.4.21.0010250146290.5505-100000@example.com>
- References: <14838.29947.837620.510820@example.com><Pine.GSO.4.21.0010250146290.5505-100000@example.com>
- Reply-To: tlug@example.com
- Resent-From: tlug@example.com
- Resent-Message-ID: <ZhmIWD.A.u0.tDp95@example.com>
- Resent-Sender: tlug-request@example.com
>>>>> "TM" == Tod McQuillin <devin@example.com> writes: TM> #!/bin/sh TM> file=/path/to/file TM> dest=`perl -e "print readlink(\"$file\");"` TM> (Actually this is a subtle hint that perl makes this kind of TM> scripting easier... but it will work in a shell script if you TM> have perl around.) -- Tod McQuillin I completely agree. From another hand, writing installation scripts in sh looks more 'real-man-ish" :) >>>>> "JM" == Jake Morrison <jacob.morrison@example.com> writes: JM> Uvator, There is a readlink(2) system call on HP/UX. JM> So..... JM> #include <unistd.h> #include <limits.h> #include <stdio.h> JM> int main(int argc, char** argv) { char buf[PATH_MAX + 1]; JM> if ( (argc < 2) || (!argv[1]) ) { fprintf(stderr, "%s: JM> usage: <symlink>\n", argv[0]); return 1; } JM> if ( readlink(argv[1], buf, PATH_MAX) == -1) { JM> perror("readlink"); return 1; } JM> printf("%s\n", buf); JM> return 0; } JM> I can compile this for you on HP/UX 10.2 if you like. Thank you, Jake, I can do it myself. >>>>> "ASZ" == A Sajjad Zaidi <sajjad@example.com> writes: ASZ> 'file $symlink_name -b | cut -c 18-' Thanks for the other replies too, it looks like fun. Viktor
- References:
- symlink destination
- From: Viktor Pavlenko <vp@example.com>
- Re: symlink destination
- From: Tod McQuillin <devin@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: symlink destination
- Next by Date: Re: Metallic DSL in Tokyo
- Prev by thread: Re: symlink destination
- Next by thread: Re: symlink destination
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links