Solved

Right syntax for UNIX CSH as the below in Linux

Posted on 2013-12-02
5
472 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
ID: 39690329
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
ID: 39690363
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
ID: 39690382
I added that but
 if [ $? -eq 0 ] ; then PATH="${PATH}:${JAVA_BINDIR}" ; fi

breaks it
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39690388
What is the actual error message?
0
 
LVL 2

Author Comment

by:bcarlis
ID: 39690400
Thank you that did it!
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Assess most serious Linux privilege escalation bug 17 146
AWS CLI - Instances, Volumes & Tagging 2 73
cannot connect to openvpn server 9 59
AD LDAP LDS 3 47
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

919 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

24 Experts available now in Live!

Get 1:1 Help Now