From: Igor Moskalev <gnitarg@bellsouth.net>
To: community@altlinux.ru
Subject: Re: [Comm] Re[2]: [Comm] Аналог Recycle Bin
Date: Thu, 28 Nov 2002 03:28:35 -0600 (CST)
Message-ID: <Pine.LNX.4.44L.0211280240110.11867-100000@localhost.localdomain> (raw)
In-Reply-To: <20021128104256.0cbbe48b.mike@stankin.ru>
On Thu, 28 Nov 2002, Mike wrote:
> On Wed, 27 Nov 2002 22:47:33 -0600 (CST)
> Igor Moskalev <gnitarg@bellsouth.net> wrote:
<skip>
> > > Интересно а если алиас сделать на команду rm как
> > > перемещение в другое
> > > место, то получится?
> > >
> >
> > Думаю, что никак. Надо сделать скрипт и уже на него
> > делать псевдоним с
> > rm, например:
> >
> > #-----------------------
> >
> > #!/bin/sh
> > #this is korzina skript
> >
> > mv $1 $HOME/Корзина
> >
> > #-----------------------
>
> А если rm задаётся с параметрами? Типа -rf ? :)
>
А какой смысл? Ведь rm -rf просто удаляет директорию рекурсивно. В то же
время, mv from to перемещает директорию from в директорию to/from если
директория to существует в to если нет. Т.е., если Вы просто хотите
рекурсивно удалить директорию, сохранив при этом ее в корзине, то мой
скрипт это сделает (попробуйте).
С другой стороны, если команда rm -rf используется в скрипте (т.е.
синтаксис нельзя заменить), то надо переписывать скрипт, например так:
#----------------------------
#!/bin/sh
if [ -z $2 ] ; then
mv $1 $HOME/Корзина/ ;
else
mv $2 $HOME/Корзина/ ;
fi
#---------------------------
Тут вообще пофигу, какие параметры для rm Вы используете, они
игнорируются :-)
Но это все изврат, конечно, чисто ради демонстрации :-) Почитайте
документацию про bash, там много интеремного.
--
С уважением,
Игорь Москалев
--------------------------------------------------------------------
"Пусть я дурак, но позвольте мне убедиться в этом самому..." (c) Pp
--------------------------------------------------------------------
next prev parent reply other threads:[~2002-11-28 9:28 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-27 20:49 Mikhail Ramendik
2002-11-27 22:30 ` Vitaly Lipatov
2002-11-28 0:06 ` [Comm] Re[2]: " Mikhail Ramendik
2002-11-28 4:20 ` jin
2002-11-28 4:47 ` Igor Moskalev
2002-11-28 7:42 ` Mike
2002-11-28 9:09 ` Vitaly Lipatov
2002-11-28 13:05 ` Vitaly Lugovsky
2002-11-28 19:00 ` [Comm] Re: [JT] " Vitaly Lipatov
2002-11-28 19:04 ` Vitaly Lugovsky
2002-11-28 23:42 ` [Comm] Re[2]: " Maksim Otstavnov
2002-11-29 10:45 ` Vitaly Lugovsky
2002-11-29 6:01 ` Alexey I. Froloff
2002-11-28 9:28 ` Igor Moskalev [this message]
2002-11-28 9:44 ` [Comm] Re[2]: [Comm] Re[2]: [Comm] " ASA
2002-11-28 9:56 ` Igor Moskalev
2002-11-28 12:59 ` Vitaly Lugovsky
2002-11-29 23:01 ` Andrey Orlov
2002-11-28 12:57 ` Vitaly Lugovsky
2002-11-28 12:53 ` Vitaly Lugovsky
2002-11-28 14:47 ` Sergey Kuznetsov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.44L.0211280240110.11867-100000@localhost.localdomain \
--to=gnitarg@bellsouth.net \
--cc=community@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git