On 03/01/07, Norman Gaywood <[EMAIL PROTECTED]> wrote:
But why are we we trying to pipe output to xargs. We are only dealing
with one name.
Or zero. I used the "xargs -r" trick to avoid running anything if there is
no output from readlink.
Whats wrong with just:
rm -rf "$(readlink link)
On Wed, Jan 03, 2007 at 04:10:45PM +1100, Amos Shapira wrote:
> On 03/01/07, Zhasper <[EMAIL PROTECTED]> wrote:
> >
> >Only because you're using the -0 flag.
>
>
> (This is also going to destroy the ability to handle whitespace in
> >filenames though, so you probably don't want to do this.)
>
>
On 03/01/07, Zhasper <[EMAIL PROTECTED]> wrote:
Only because you're using the -0 flag.
...
(This is also going to destroy the ability to handle whitespace in
filenames though, so you probably don't want to do this.)
Correct on both accounts, but this is why I insist on using -0 whenever
On 1/3/07, Amos Shapira <[EMAIL PROTECTED]> wrote:
On 03/01/07, Penedo <[EMAIL PROTECTED]> wrote:
> readlink -fe link | xargs -0r rm -rf
>
Correction to the above - apparently xargs waits for "\0" in order to
terminate its input,
Only because you're using the -0 flag.
--null, -0
On 03/01/07, Penedo <[EMAIL PROTECTED]> wrote:
readlink -fe link | xargs -0r rm -rf
Correction to the above - apparently xargs waits for "\0" in order to
terminate its input, so maybe the following is more appropriate:
$ (readlink -fen link ; echo -e \\0) | xargs -0r rm -rf
--Amos
--
SLUG
On Wed, Jan 03, 2007 at 03:20:09PM +1100, Penedo wrote:
> Sorry Simon, I was going to pass but then I saw readlink(1), so something
> like:
>
> readlink -fe link | xargs -0r rm -rf
>
> Should do the trick.
Well spotted! I had never noticed readlink before. It will indeed do
the trick. Also remo
On 1/3/07, Norman Gaywood <[EMAIL PROTECTED]> wrote:
I must be missing something simple.
$ mkdir dir
$ ln -s dir link
$ rm link/
rm: cannot remove `link/': Not a directory
$ rm -f link/
rm: cannot remove `link/': Not a directory
$ rm -rf link/
rm: cannot remove `link/': Not a directory
$ rmdir l
On Wed, 2007-01-03 at 14:36 +1100, Norman Gaywood wrote:
> I must be missing something simple.
>
> $ mkdir dir
> $ ln -s dir link
> $ rm link/
> rm: cannot remove `link/': Not a directory
> $ rm -f link/
> rm: cannot remove `link/': Not a directory
> $ rm -rf link/
> rm: cannot remove `link/': Not
On 03/01/07, Simon Males <[EMAIL PROTECTED]> wrote:
> On Wed, Jan 03, 2007 at 02:41:51PM +1100, Simon Males wrote:
>> Been there.
>>
>> rm link
>>
>> No trailing slash.
>
> No, that removes the link, not the directory pointed to by the link.
>
> Thanks anyway.
Got a bit to excited.
rm -ri "`
I must be missing something simple.
$ mkdir dir
$ ln -s dir link
$ rm link/
rm: cannot remove `link/': Not a directory
$ rm -f link/
rm: cannot remove `link/': Not a directory
$ rm -rf link/
rm: cannot remove `link/': Not a directory
$ rmdir link/
rmdir: link/: Not a directory
$ rm -rf link/.
rm:
> On Wed, Jan 03, 2007 at 02:41:51PM +1100, Simon Males wrote:
>> Been there.
>>
>> rm link
>>
>> No trailing slash.
>
> No, that removes the link, not the directory pointed to by the link.
>
> Thanks anyway.
Got a bit to excited.
rm -ri "`ls -l link | awk -F' ' {'print $11'}`"
To dynamify it,
Been there.
rm link
No trailing slash.
> I must be missing something simple.
>
> $ mkdir dir
> $ ln -s dir link
> $ rm link/
> rm: cannot remove `link/': Not a directory
> $ rm -f link/
> rm: cannot remove `link/': Not a directory
> $ rm -rf link/
> rm: cannot remove `link/': Not a directory
>
On Wed, Jan 03, 2007 at 02:41:51PM +1100, Simon Males wrote:
> Been there.
>
> rm link
>
> No trailing slash.
No, that removes the link, not the directory pointed to by the link.
Thanks anyway.
> > I must be missing something simple.
> >
> > $ mkdir dir
> > $ ln -s dir link
> > $ rm link/
> >
I must be missing something simple.
$ mkdir dir
$ ln -s dir link
$ rm link/
rm: cannot remove `link/': Not a directory
$ rm -f link/
rm: cannot remove `link/': Not a directory
$ rm -rf link/
rm: cannot remove `link/': Not a directory
$ rmdir link/
rmdir: link/: Not a directory
$ rm -rf link/.
rm:
14 matches
Mail list logo