BASH alias not working...

Dennis Kaarsemaker dennis at kaarsemaker.net
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: http://www.ubuntulinux.org
  - Linux voor normale mensen: http://www.ubuntulinux.nl
-------------- 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: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050621/e5266459/attachment.pgp>


More information about the ubuntu-users mailing list