Solved

Right syntax for UNIX CSH as the below in Linux

Posted on 2013-12-02
5
478 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.
Suggested Courses

738 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