gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Convenience shell macros


From: Brian May
Subject: Re: [Gnu-arch-users] Convenience shell macros
Date: Mon, 02 Feb 2004 12:48:29 +1100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

>>>>> "Jan" == Jan Hudec <address@hidden> writes:

    Jan> Off the top of my head (not testing it):
    Jan> trd() {
    Jan> if [ -r "$1/.arch-ids/=id" ]; then
    Jan> ID=$(cat "$1/.arch-ids/=id")
    Jan> rm "$1/.arch-ids/=id" &&
    Jan> rmdir "$1/.arch-ids" &&
    Jan> rmdir "$1" ||
    Jan> tla add --id "$ID" "$1"
    Jan> else
    Jan> rmdir "$1"
    Jan> fi
    Jan> }

Works great!

Thanks.

The only change I had to do was to insert "-f" in the rm command, as
otherwise it will prompt me if I really want to remove the file (I
have rm aliased to "rm -i").
-- 
Brian May <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]