The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-04-2006
pau pau is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 39
automatically open

Hi

I am trying to write a script to automatically use a predefined program to open a file according to its extension... But I don't know how to pass "programeta" ...

Code:
while [[ $1 = -* ]]; do
        case $1 in
                -pdf ) programeta="kpdf"
                       shift 1 ;;
                -ps ) programeta="ggv"
                       shift 1 ;;
                -ps.gz ) programeta="ggv"
                       shift 1 ;;
                -tex ) programeta="vim"
                       shift 1 ;;
                *  )   print -u2 "No sé de què va $1 (o no és lliure i no pense obrir-ho)"
                       exit 1 ;;
        esac
done
any hint? thanks