Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I see this all the time in manual pages, usually referring to --verbose flags.

From the ln manual page:

The -h, -i, -n and -v options are non-standard and their use in scripts is not recommended.

What exactly does this mean? Specifically for this case, I have a script that creates symlinks and I want it to write a list of created links to a file. Can I use ln -v or should I use a different method?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Remember there are several versions of UNIX, with several versions of command line utilites.

Possibly better wording would be:

The -h, -i, -n and -v options are non-standard across different versions and their use in portable scripts is not recommended.

share|improve this answer
    
Ah, okay, that makes more sense now. If I'm just using the script on a specific OS, then it should be okay, right? Or if I test it everywhere it'll be used? –  Blacklight Shining Aug 12 '12 at 2:16
    
@BlacklightShining I'd test every time you put the script on a new OS. Linux vs. OSX vs FreeBSD for example. My guess is you'll not really have too many targets, and this is a theoretical, not a practical issue. –  Rich Homolka Aug 12 '12 at 3:35

The full quote goes like this:

The -h, -i, -n and -v options are non-standard and their use in scripts is not recommended. They are provided solely for compatibility with other ln implementations.

I've looked at a number of versions of the ln man page, and I noticed that none of these options appear in the POSIX spec for ln or in older versions of UNIX. Early versions had no options at all. The -s option was added when symbolic links were invented, and -f was a standard option added to a number of commands to handle a very common use case. That was it for mainstream Unix, where people preferred minimalistic toolsets.

I'm guessing, but it seems likely to me that most of the options used in popular implementations of ln were invented by Project GNU. Project GNU ("GNU's Not Unix!") started out as a volunteer effort to create a free clone of Unix. As you can see, Project GNU loves to hack out clever little features, so it makes sense that all these new options were their idea.

Project GNU never really produced a working OS (they're still working on it!), but their libraries and utilities became standard features of Linux distributions. (Which is why GNU diehards insist on referring to "GNU/Linux".) Linux features that became popular tended to be copied over to various implementations of Unix. Some (but not all) of GNU's additions to ln seem to have appeared in mainstream Unix implementations, such as Solaris and BSD. I suspect that BSD people felt that these four options were forced on them — hence the curmudgeonly deprecation in the man page.

OS X utilities are based on those for BSD, so the deprecation also appears there. I haven't found it on any system not based on BSD.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.