🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: ch.comp.os.linux
Article #12424

Re: Pruefen von symbolische links

#12424
From: Christian Strub
Date: Thu, 05 Jul 2001 09:03
62 lines
2787 bytes
Hallo Roberto,

Leider gibt file mir immer den gleichen rueckgabewert :(

natalie@natalie:/h/natalie> echo "blabla" > foo
natalie@natalie:/h/natalie> file foo
foo:            ascii text
natalie@natalie:/h/natalie> echo $?
0
natalie@natalie:/h/natalie> rm foo
natalie@natalie:/h/natalie> echo $?
0
natalie@natalie:/h/natalie> file foo
foo:            cannot open
natalie@natalie:/h/natalie> echo $?
0
natalie@natalie:/h/natalie>

habe was anderes gemacht, ist nicht genial, scheint aber so zu gehen.
naja ist mehr etwas billiges (nicht sehr zufriedenstellend) und sehr
anfaellig auf das Trennzeichen ">"

natalie@natalie:/h/natalie> ls -al foo
lrwxrwxr-x   1 natalie    users            3 Jul  5 10:57 foo -> bar
natalie@natalie:/h/natalie> rm bar
natalie@natalie:/h/natalie> ls `ls -al foo | cut -d">" -f2`
bar not found
natalie@natalie:/h/natalie> echo $?
2
natalie@natalie:/h/natalie>

Gruss
Christian

Roberto Nibali wrote:

> Hallo Christian,
>
> > mit welchem tool kann man testen ob ein symbolischer link ins leere
> > zeigt?
>
> zar:/tmp # ls -al bar
> ls: bar: No such file or directory
> zar:/tmp # ln -s bar foo
> zar:/tmp # ls -al foo
> lrwxrwxrwx   1 root     root            3 Jul  5 09:39 foo -> bar
> zar:/tmp # test -h foo && file foo
> foo: broken symbolic link to bar
> zar:/tmp #
>
> > Dies brauche ich fuer HP-UX 10.20 (und linux).
>
> Hab leider meine HP-UX box nicht zur Hand und weiss auch nicht
> auswendig, ob das magic fuer file unter HP die gleiche Meldung
> gibt. Musst es selbst ausprobieren oder warten, bis ich wieder
> zu Hause bin :)
>
> Gruss,
> Roberto Nibali, ratz
>
> --
> mailto: `echo NrOatSz@tPacA.cMh | sed 's/[NOSPAM]//g'`
Technical Details
Message-ID: <3B442D76.F78EB891@siemens.ch>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!130.59.214.20!news-ge.switch.ch!news!news.siemens.ch!not-for-mail
References: <3B441847.381424C4@siemens.ch> <3B441A75.2CF14D98@tac.ch>

Show Full Headers
Complete Article Headers
X-Google-Language: GERMAN,ASCII-7-bit
X-Google-Thread: f4b73,67e615da96b01c88
X-Google-Attributes: gidf4b73,public
X-Google-ArrivalTime: 2001-07-05 02:03:53 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!130.59.214.20!news-ge.switch.ch!news!news.siemens.ch!not-for-mail
From: Christian Strub <christian.strub@siemens.ch>
Newsgroups: ch.comp.os.linux
Subject: Re: Pruefen von symbolische links
Date: Thu, 05 Jul 2001 11:03:50 +0200
Organization: Siemens Switzerland Ltd
Lines: 63
Message-ID: <3B442D76.F78EB891@siemens.ch>
References: <3B441847.381424C4@siemens.ch> <3B441A75.2CF14D98@tac.ch>
NNTP-Posting-Host: myrta.es3.siemens.ch
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: zrha108x.zrh.siemens.ch 994323831 12116 139.24.2.82 (5 Jul 2001 09:03:51 GMT)
X-Complaints-To: support.web@siemens-sbs.ch
NNTP-Posting-Date: Thu, 5 Jul 2001 09:03:51 +0000 (UTC)
X-Mailer: Mozilla 4.72 [en] (X11; U; HP-UX B.10.20 9000/785)
X-Accept-Language: en