Solved

Right syntax for UNIX CSH as the below in Linux

Posted on 2013-12-02
5
468 Views
Last Modified: 2013-12-02
Hi All,
I am having a hard time finding the right syntax for UNIX CSH as the below in Linux

 
echo $PATH | /bin/grep -v "${JAVA_BINDIR}"
if [ $? -eq 0 ]; then export PATH="${PATH}:${JAVA_BINDIR}"; fi

GLASSFISH_PARENT=/oracle/product/glassfish4
GLASSFISH_HOME=/oracle/product/glassfish4/glassfish
echo $PATH | /bin/grep -q -v "${GLASSFISH_HOME}/bin"
if [ $? -eq 0 ]; then export PATH="${PATH}:${GLASSFISH_HOME}/bin"; fi

Open in new window



echo $SHELL
/bin/csh

Thank you for your help, Bill
0
Comment
Question by:bcarlis
  • 3
  • 2
5 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
Why would you want to use csh?

Just add this as the very first line to your script:

#!/bin/bash

and everything will be fine.

wmp
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
Comment Utility
If you insist - here is the csh version:

echo $PATH | /bin/grep -q -v "${JAVA_BINDIR}"
if ( $status == 0 ) then
     setenv PATH "${PATH}:${JAVA_BINDIR}"
endif

setenv GLASSFISH_PARENT /oracle/product/glassfish4
setenv GLASSFISH_HOME /oracle/product/glassfish4/glassfish

echo $PATH | /bin/grep -q -v "${GLASSFISH_HOME}/bin"
if ( $status == 0 ) then
  setenv PATH "${PATH}:${GLASSFISH_HOME}/bin"
endif

Open in new window

0
 
LVL 2

Author Comment

by:bcarlis
Comment Utility
I added that but
 if [ $? -eq 0 ] ; then PATH="${PATH}:${JAVA_BINDIR}" ; fi

breaks it
0
 
LVL 68

Expert Comment

by:woolmilkporc
Comment Utility
What is the actual error message?
0
 
LVL 2

Author Comment

by:bcarlis
Comment Utility
Thank you that did it!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now