LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-22-2005, 09:32 AM   #1
bkeeper
LQ Newbie
 
Registered: Dec 2005
Location: Muenchen, Germany
Posts: 25

Rep: Reputation: 16
Cool how to make ln check whether target exists


Hi there,
I was wondering whether there would be a possibility to make ln check whether the target I'm trying to put a symbolik link pointing to really exists. In the end, I'd like to have an error message (or something like "are you sure?) if it doesn't.
So far, the only possibility I came up with is to make a small script that pings the target file, and then to alias this script. But maybe there's another way? - Just curious; at least in the man pages there's nothing written.
Cheers
bkeeper
 
Old 12-22-2005, 03:09 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
It already does that.

Example

$ ln nothing here
ln: accessing `nothing': No such file or directory
$
 
Old 12-23-2005, 03:51 AM   #3
bkeeper
LQ Newbie
 
Registered: Dec 2005
Location: Muenchen, Germany
Posts: 25

Original Poster
Rep: Reputation: 16
Hihi...
Yes, for a hard link indeed. But not for a soft link!
bkeeper
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ksh check if file exists (using wildcard) problem r18044 Linux - Newbie 5 02-22-2005 07:52 AM
lopster v1.2.2 make error: No rule to make target `m4/glibc21.m4' Kropotkin Fedora 0 10-31-2004 11:19 AM
make: *** No rule to make target 'gconfig'. Stop. cswake Slackware 4 10-10-2004 12:13 PM
c++ check if file exists Genjix Programming 3 03-15-2004 12:08 AM
make: **** No rule to make target 'bzImage' qingjuan Linux - General 5 04-02-2002 04:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration