[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnu-arch-users] avoiding symlinks
From: |
Zenaan Harkness |
Subject: |
[Gnu-arch-users] avoiding symlinks |
Date: |
Tue, 16 Nov 2004 13:10:29 +1100 |
How do avoid symlinks with tla inventory? There is the following option:
-f, --files list only non-directories
But that clearly includes symlinks, and my sed scripts keep stopping
half way through due to sed's "short circuit if any error" behaviour.
I'm getting a little frustrated with manually editing files that don't
get past the short-circuit, so a solution to this problem would be
great!
Unix "find" has various options, and bash's shell scripting conditionals
include various options to distinguish between these different entities.
But tla inventory doesn't, which then requires manual piping of various
grep -v incantations into my pipeline, which suddenly makes the whole
thing a long and laborious exercise, for what should be a simple global
search and replace on my files.
To be really clear on the problem: tla inventory's "--files" options
assumes that symlinks to directories are "non directories", which makes
sense, but when would I ever need to grep a symlink to a directory?
And what makes it further frustrating, is that tla inventory is
descending into a directory that is not part of my archive (it's my
build/ dir); and to make it doubly frustrating, when I try to use tla
inventory _inside_ this build/ dir to descend into various directories,
it won't descend into sub directories if those sub directories are just
symlinks, making it tla inventory not useful for my release scripts
(I've resorted to custom find etc).
STOP PRESS: Workaround: I just found one workaround, which uses only
three extra keystrokes (although seems rather inefficient and defeats
what I thought was the purpose of xargs):
tla inventory ...|xargs -n 1 sed ...
This results in xargs calling the command once for every argument, which
has sed spew a bunch of errors (one for every symlink it comes across).
FYI
Zenaan
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnu-arch-users] avoiding symlinks,
Zenaan Harkness <=