l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
July 21: Defensive computing: Information security for individuals
Next Installfest:
TBD
Latest News:
Jul. 4: July, August and September: Security, Photography and Programming for Kids
Page last updated:
2003 May 14 12:45

The following is an archive of a post made to our 'vox mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox] Stupid User Tricks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox] Stupid User Tricks



On bash, try writing a script:

   /bin/rm-safe:
      #!/bin/bash

      # Configurable
      TRASH=$HOME/Trash

      # Create the trash directory, if it doesn't exist
      if [ \! -d "$TRASH" ]; then
         mkdir $TRASH
      fi

      # Move the file to the trash
      mv $* "$TRASH"

then:

   alias rm='/bin/rm-safe'

or something similar.  it creates ~/Trash automatically, to boot!  but
`rm -rf dir` yields:

   mv: invalid option -- r
   Try `mv --help' for more information.

what's more, a simple `rm dir` yields moving the directory to the ~/Trash.
Somewhat unfortunate.

-Mark

On Wed, 14 May 2003, Jay Strauss wrote:

> I use bash, (and after writing my reply realized it probably wont work in
> bash)
>
> Jay
> ----- Original Message -----
> From: "Peter Jay Salzman" <p@dirac.org>
> To: <vox@lists.lugod.org>
> Sent: Tuesday, May 13, 2003 10:31 PM
> Subject: Re: [vox] Stupid User Tricks
>
>
> > jay, surely you don't use csh?!?   ;)
> >
> > just kidding, of course.
> >
> > pete
> >
> >
> >
> > On Tue 13 May 03, 10:09 PM, Jay Strauss <me@heyjay.com> opined:
> > > That's what I figured, but didn't know what language it was in.  Thanks
> (and
> > > adding it to my machine now)
> > >
> > > Jay
> > > ----- Original Message -----
> > > From: "Peter Jay Salzman" <p@dirac.org>
> > > To: <vox@lists.lugod.org>
> > > Sent: Tuesday, May 13, 2003 9:22 PM
> > > Subject: Re: [vox] Stupid User Tricks
> > >
> > >
> > > > hi jay,
> > > >
> > > > has nothing to do with a regex, although it certainly looks like one.
> > > >
> > > > i had to look twice before i realized that it's a csh style glob.
> > > > basically \!* means "all arguments" in csh/tcsh.
> > > >
> > > > pete
> > > >
> > > >
> > > > On Tue 13 May 03,  9:01 PM, Jay Strauss <me@heyjay.com> opined:
> > > > > I get what it does, but not how it does it.
> > > > >
> > > > > what is \!*, is this a regex?  If so it looks like "not anything",
> which
> > > > > obviously it can't be.
> > > > >
> > > > > Jay
> > > > > ----- Original Message -----
> > > > > From: "Norm Matloff" <matloff@laura.cs.ucdavis.edu>
> > > > > To: <vox@lists.lugod.org>
> > > > > Sent: Tuesday, May 13, 2003 5:52 PM
> > > > > Subject: Re: [vox] Stupid User Tricks
> > > > >
> > > > >
> > > > > >
> > > > > > I had thought that everyone had rm aliased, e.g.
> > > > > >
> > > > > > alias rm 'mv \!* ~/Trash'
> > > > > >
> > > > > > Norm
> >
> > --
> > GPG Instructions: http://www.dirac.org/linux/gpg
> > GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D
> > _______________________________________________
> > vox mailing list
> > vox@lists.lugod.org
> > http://lists.lugod.org/mailman/listinfo/vox
> >
> >
>
> _______________________________________________
> vox mailing list
> vox@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox
>

-- 
Mark K. Kim
http://www.cbreak.org/
PGP key available upon request.

_______________________________________________
vox mailing list
vox@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.