Sponsored Content
Full Discussion: Shell scripting/menu
Homework and Emergencies Homework & Coursework Questions Shell scripting/menu Post 302803037 by Don Cragun on Monday 6th of May 2013 12:27:50 AM
Old 05-06-2013
Quote:
Originally Posted by Jagst3r21
I stripped it down to this:

Code:
# Use of a case statement to offer a 5 item menu
echo "  Menu\n
1. Copy a file to a designated directory\n
5. Quit to Unix\nEnter your option #: \c"
 
read choice
 
case "$choice" in
while true
do
1)      echo " Chose a file to be copied to your /etc directory;;
       read filename;;
       cp $filename /etc;;
done
5)      exit ;;
*)      echo "Invalid option"   # ;; not needed for last option
esac

but I am getting ./example: 8: Syntax error: word unexpected (expecting ")")

any ideas?
I suggested some ideas in message #8 in this thread. It doesn't look like you considered anything I posted there, and the problems you're showing here seem to be the same as the problems you had then.

Is this really an exact copy of the script you ran when you got the error message above? I would have expected it to complain about line 9 instead of line 8 with the code you listed above.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

scripting for menu

Hi, I'm writting a script to filter a cvs log and get only the modified files to move them to a specific directory to compile. I try to filter a line and move from source to target, with no results. Could you help me? for example, in the cvs log file appears: cat log.txt U... (2 Replies)
Discussion started by: Manu
2 Replies

2. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

3. Shell Programming and Scripting

Scripting problem - when the file is not found i want it to return to the menu

when the file is not found i want it to return to the menu, however it carries out the next line when i hit a key I know its probably something simple can anyone help? here is my pause function: function pause(){ read -s -n 1 -p "Press any key to return to Menu . . ." echo } SCRIPT... (2 Replies)
Discussion started by: Alendrin
2 Replies

4. Shell Programming and Scripting

help with scripting a simple menu

Hi there. I'm trying to teach myself UNIX but the book I bought is a bit confusing. I'm trying out this exercise and I think I'm on the right track, but I'd appreciate any suggestions on how to improve what I have so far. Also, I'm not clear on how to use the read command to utilize the user's... (3 Replies)
Discussion started by: Jsmith
3 Replies

5. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

6. UNIX for Dummies Questions & Answers

Scripting menu problem

Hi there, I am new to Unix and at the moment I am trying to solve my assignment that is to create a script for the program to prompt user to type three codes, from user point of view it should be done by typing codes separating them by spaces. Then program displays a menu with these three... (5 Replies)
Discussion started by: Dannel
5 Replies

7. Shell Programming and Scripting

Shell script menu

hi guys, how would you do the following? I have a menu with 5 options in my shell script: 1. Run function 1 against files 2. Run function 2 against files 3. Run function 3 against files 4. Run function 4 against files 5. Run function 5 against files I'd like to be able to run multiple... (10 Replies)
Discussion started by: rich@ardz
10 Replies

8. Shell Programming and Scripting

Menu using shell script

Hi, I need to have a shell script for the below need. 1. Menu with one heading and 4 options. 2. the heading and 4 options are taken from a file. File entry ====== Heading1|option1|option2|option3|option4| Heading2|option1|option2|option3|option4| 3. the user entries must be captured in... (9 Replies)
Discussion started by: umastinu
9 Replies

9. Shell Programming and Scripting

Menu shell script help

Hi All, I have written a shell script that show menu driven option. My requirement is that in the menu driven option i want to select multiple choice. i.e if i want to select 1 or 1,2 or 1,2,3 or 2,3 etc .... Can some one help me in that My script. while true; do echo " " ... (8 Replies)
Discussion started by: Nawrajesh
8 Replies

10. Shell Programming and Scripting

Menu and case statement scripting

hi all i am trying to get help with writing a script using case statement to display menu as 1) Authentication log 2) System log 3) Messages 4) Dmesg 5) Boot log Q) Exit When selecting the menu by 1 or 2 or 3 o 4 or 5, it should display the last 10 lines of the log files, if... (3 Replies)
Discussion started by: renegade11
3 Replies
asadmin-version(1AS)						   User Commands					      asadmin-version(1AS)

NAME
asadmin-version, version - displays theversion information SYNOPSIS
version [--user admin_user] [--password admin_password] [--host localhost] [--port 4848] [--secure |-s] [--passwordfile filename] [--terse=false] [--echo=false] [--interactive] [--verbose=false] version displays the version information. If the command-line cannot communicate with the administration server with the given user/pass- word and host/port, then the command-line will retrieve the Version locally and display a warning message. If the user option is not entered, the command-line will retrieve the version locally and display a warning message. The warning message will not be displayed if --terse option is entered on the command line. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. --echo setting to true will echo the command line statement on the standard output. --interactive prompts you for the required options that are not already specified. --verbose displays version information in detail. Example 1: Using remote mode to display version asadmin> version Java 2 Platform Enterprise Edition 1.4 Application Server Example 2: Using remote mode to display version in detail asadmin> version --user admin --password adminadmin --host bluestar --port 4848 --verbose Java 2 Platform Enterprise Edition 1.4 Application Server (build A021930-126949) EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-help(1AS) J2EE 1.4 SDK March 2004 asadmin-version(1AS)
All times are GMT -4. The time now is 09:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy