On Vi, 19 iul 13, 21:15:35, Claudius Hubig wrote:
Dear Oscar,
what a surprising name…
OECT T wrote:
I need to delete the file resulting from: ls | tail -1
How do you know the last file in the output of 'ls' is the one you need?
I'd rather use find with -delete for something like this.
Claudius Hubig [2013-07-19 21:15:35 +02:00] wrote:
$ rm -i $(ls | tail -1)
When the file list is unknown (i.e., comes from a variable or pipe etc.)
it is often a good idea to separete options and filenames with the
pseudo-option --:
$ rm -i -- $(ls | tail -1)
This way filenames which look
Dear Oscar,
what a surprising name…
OECT T wrote:
I need to delete the file resulting from: ls | tail -1
In Bash, $(command) is replaced with the output of command. For
example,
$ touch $(seq 1 4)
will create files 1, 2, 3 and 4. So you likely want something like
$ rm -i $(ls | tail -1)
Hola:
I need to delete the file resulting from: ls | tail -1
I've tried some commands resulting from Google searches without success. OS is
Debian squeeze 6.0.7
I'll appreciate any hints
Regards
Oscar Corte
Date: Fri, 19 Jul 2013 21:15:35 +0200
From: debian_1...@chubig.net
To: debian-user@lists.debian.org
Subject: Re: Remove file resulting from ls|tail -1
Dear Oscar,
what a surprising name…
Thanks
OECT T wrote:
I need to delete the file resulting from: ls | tail -1
In Bash
5 matches
Mail list logo