On Mon, Feb 21, 2000 at 04:12:13PM -0800, Hidong Kim wrote:
| How would you convert the following two csh script blocks to bash
| script?

Well, I'd convert it to generic Bourne shell rather than relying on weird
bash dialects - it will work elsewhere than GNU/Linux then ... so take to
saying "Bourne shell" or just "shell" rather than "bash".

| if !($?BIOSYM) then
|   echo "** "
|   echo '** Variable $BIOSYM undefined'
|   echo '** You need to source the cshrc file that comes with the CNX'
|   echo '** installation.  Refer to the CNX documentation.'
|   echo "** "
|   exit 1
| endif
| 
| echo -n "Enter location of CNX directory [default: $cnx_dir ]-> "
| set response=$<
| if ( $response != "" ) then
|   set cnx_dir=`echo $response | sed -e 's/\/$//'`
| endif

Like so:

        if [ -z "$BIOSYM" ]; then
          echo "** "
          echo '** Variable $BIOSYM undefined'
          echo '** You need to source the cshrc file that comes with the CNX'
          echo '** installation.  Refer to the CNX documentation.'
          echo "** "
          exit 1
        fi

        echo -n "Enter location of CNX directory [default: $cnx_dir ]-> "
        read response
        if [ -n "$response" ]; then
          cnx_dir=`echo $response | sed -e 's/\/$//'`
        fi

Cheers,
-- 
Cameron Simpson, DoD#743        [EMAIL PROTECTED]    http://www.zip.com.au/~cs/

I'm Bubba of Borg.  Y'all fixin' to be assimilated.


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to