BASH alias not working...

Matthew S-H mathbymath at aol.com
Mon Jun 20 23:43:24 UTC 2005


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---

Before I continued any further with this script, I wanted to test to  
see if that worked.  However, it didn't...

It gives we the following error:
-bash: test: -eq: unary operator expected

What am I doing wrong?

Any help would be appreciated.




More information about the ubuntu-users mailing list