LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-24-2012, 01:46 PM   #1
dorlack
Member
 
Registered: Oct 2009
Location: Cambridge MA
Distribution: Any Linux
Posts: 122

Rep: Reputation: 2
RHEL menu script


Hi Team,

I am new with Linux and with scripting. I have an application running on my LSF grid environment. One of my tasks is to learn our undocumented environment.

So it appears that when a user is created, .bash_profile is pushed to their /home. Within .bash_profile there is a script for one of our applications that runs within Grid. The script allows the end user to type the name of the application in, and in return it then starts the application.

I recently installed a newer version of this application. The team that uses the application needs both 2009 and 2011 versions.

Right now the user has to edit their .bash_profile and modify the DIR to the version they want to run.

My idea was to create a menu script that the user can run that will give them a choice of what versions they want to run.

Pleas remember I am very new to scripting and am trying to learn. Below is a script I started writing to at least get something down. I was hoping you guys can take a look and maybe make some suggestions.

script to create menus and take action according to that selected menu item.
#
#
while :
do
clear
echo "----------------------------------------------"
echo " * * * * * * * ABC Menu * * * * * * * * * * "
echo "----------------------------------------------"
echo "[1] ABC 2011
echo "[2] ABC 2009
echo "[3] Exit/stop"
echo "----------------------------------------------"
echo -n "Enter your menu choice [1-5]:"
read yourch
case $yourch in
1) # ABC
abc_DIR=/apps/abc2011
abc_LICENSE_FILE=1798@lserver
PATH=.:$abc_DIR/bin:$PATH
export abc_DIR abcFD_LICENSE_FILE PATH
2) # ABC
abc_DIR=/apps/abc2009
abc_LICENSE_FILE=1798@lserver
PATH=.:$abc_DIR/bin:$PATH
export abc_DIR abcFD_LICENSE_FILE PATH
3) exit 0 ;;
*) e*) echo "Opps!!! Please select choice 1,2,3,4,5,6,7 or 8"
echo "Press a key. . ."
read -n 1
;;
esac
done

-------------------------
thanks for the help in advance guys.
 
Old 03-24-2012, 01:53 PM   #2
dorlack
Member
 
Registered: Oct 2009
Location: Cambridge MA
Distribution: Any Linux
Posts: 122

Original Poster
Rep: Reputation: 2
Some additional information

# ABC
abc_DIR=/apps/abc2011
abc_LICENSE_FILE=1798@lserver
PATH=.:$abc_DIR/bin:$PATH
export abc_DIR abcFD_LICENSE_FILE PATH

this is the script in .bash_profile
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to edit right click dropdown menu in RHEL ws4 cruise.xiong Red Hat 1 08-18-2010 06:28 AM
Send input from one script to another menu based script. simonedgcumbe Programming 9 03-24-2010 10:22 PM
script menu file please Programming 7 01-02-2009 04:27 AM
[SOLVED] Grub menu not coming; XP & RHEL Dual boot vikas027 Linux - Newbie 5 10-16-2007 12:12 AM


All times are GMT -5. The time now is 08:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration