Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash scripting across linux and solaris



Hi all,

I'm writing a bash script which I would like to execute the same script 
on a linux and a solaris system. but my problem is that the bash 
executable is in /usr on linux and /usr/bin on solaris. So how do I 
define the first line #! syntax so that the shell which is executing the 
script knows where to pick up the executable.

For example, the syntax of my simple script under linux would be

#!/bin/bash
echo Hello World

and under solaris would be

#!/usr/bin/bash
echo Hello World

I remember some syntax which would tell the system running the script to 
look in the path for the shell executable, but I can't remember the 
syntax and I'm having a hard time finding it searching google. Does 
anyone know the best solution?

Thanks in advance. Steve.







BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org