BASH alias not working...

Dennis Kaarsemaker dennis at
Tue Jun 21 00:35:00 UTC 2005

On ma, 2005-06-20 at 19:43 -0400, Matthew S-H wrote:
> This is the code I added to my "~/.bashrc":
> ---START---
> alias "choose_to_edit"="cat /dev/null &&
>       cd ~/Documents/ &&
>       command ls | grep -n -v 'randomcraptonotmatch' | column &&
>       echo 'Choose which one to edit:' &&
>       read &&
>       if test $REPLY -eq 1 ;
>        then cat /dev/null &&
>          echo 'test';
>       fi"
> ---END---

Why the cat /dev/null? Why the useless grep? Why all the &&?

A clean version of this would be:

$EDITOR `zenity --file-selection --title "Choose file to edit"`

If you want it to be command line and this is not all of your script,
please read the advanced bash scripting guide and make a proper script
of this. aliases aren't meant to do these kind of things.
Dennis K.
  - Linux for human beings:
  - Linux voor normale mensen:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the ubuntu-users mailing list