Sponsored Content
Top Forums Shell Programming and Scripting Menus in Korn Shell and invalid selections Post 302263952 by Mudja on Tuesday 2nd of December 2008 07:22:11 PM
Old 12-02-2008
vgersh,

thanks so much for your quick response! I implemented the code and played around with it but couldnt find a way to use variables in the situation. Instead of John, Fred, Steve and bubba I need $VarFriend1, $VarFriend2, and $Varfriend3 - with these values set by the user with the previous command:

read VarFriend1 VarFriend2 VarFriend3

I seem to have trouble assigning the variable names these other variables...it just prints them as normal text.

So ideally, the code would go:

"Please enter your friends' names, seperated by spaces":

John Fred Steve (entered by user)

Then it would display these names like in the code you provided as values of $VarFriend1 $VarFriend2 and $VarFriend3.


Cheers for your help so far buddy Smilie I've felt I've gotten a lot further so far already!

Last edited by Mudja; 12-02-2008 at 08:40 PM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to convert from korn shell to normal shell with this code?

well i have this code here..and it works fine in kornshell.. #!/bin/ksh home=c:/..../ input=$1 sed '1,3d' $input > $1.out line="" cat $1.out | while read a do line="$line $a" done echo $line > $1 rm $1.out however...now i want it just in normal sh mode..how to convert this?... (21 Replies)
Discussion started by: forevercalz
21 Replies

2. Shell Programming and Scripting

Shell Script Menus - Rejecting invalid input (KSH)

Greetings all, I'm currently writing a shell script menu which is dynamically populated from an array. Have a question to ask about the filtering of invalid input. I'm using KSH. A brief description of my algorithm is as follows: 1) Read in input from user and store in a variable. (a valid... (2 Replies)
Discussion started by: rockysfr
2 Replies

3. Shell Programming and Scripting

menu selections

I am trying to find a way to allow users to select multiple options in a shell menu. I am using case and it gives menu options 1-9, how can I set this up so that it give the user the ability to choose more then one option, ie 1,2 or 3,4,5, etc... (4 Replies)
Discussion started by: lwif
4 Replies

4. UNIX for Advanced & Expert Users

Shell menus And Oracle

Dear All, Kindly suggest on how should i proceed with the following requirement I need to develop an interactive shell script menu which would enable the user to inquire the value of a column based on a key value . The output can be more records.. Also is it possible to do the following 1)... (2 Replies)
Discussion started by: ksm
2 Replies

5. Shell Programming and Scripting

01.30 Invalid shell error

Hi, I am getting the error 01.30 Invalid shell error I am running the bash shell script in the korn login shell. I have mentioned the #!/bin/bash statement in the my script but not sure why it is giving this error to me.. (4 Replies)
Discussion started by: mr_harish80
4 Replies

6. Shell Programming and Scripting

How to activate Korn Shell functionnalities in Bourne Shell

Hi All I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell. Some operations like calculation don't work : cat ${file1} | tail -$((${num1}-${num2})) > ${file2} Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies

7. Solaris

Detect Invalid Data by C shell

Dear all, I'd be so grateful if I could get great feedback again for my problems. We usually spool some text files from our system in csv format. Unfortunately, some data contains ',' (comma) and it's rare case but when it comes to spool, that row included comma should be invalid data, due... (2 Replies)
Discussion started by: elph
2 Replies

8. UNIX for Dummies Questions & Answers

Invalid option errors running shell script

The script below fails with the following error messages: gzip: invalid option -- 'w' Try `gzip --help' for more information. mysqldump: Got errno 32 on write cp: invalid option -- 'w' Try `cp --help' for more information. rm: invalid option -- 'w' Try `rm --help' for more information. ... (1 Reply)
Discussion started by: ANNACTION
1 Replies

9. Shell Programming and Scripting

Shell Scripting Problem - Invalid Back Reference

Here is the question... Create a new script, sub2, taking three parameters... 1.) the string to be replaced 2.) the string with which to replace it 3.) the name of the file in which to make the substitution ...that treats the string to be replaced as plain text instead of as a regular... (1 Reply)
Discussion started by: johnhisenburg
1 Replies
CANFIELD(6)							 BSD Games Manual						       CANFIELD(6)

NAME
canfield, cfscores -- the solitaire card game canfield SYNOPSIS
canfield cfscores [-a] [user] DESCRIPTION
If you have never played solitaire before, it is recommended that you consult a solitaire instruction book. In Canfield, tableau cards may be built on each other downward in alternate colors. An entire pile must be moved as a unit in building. Top cards of the piles are available to be played on foundations, but never into empty spaces. Spaces must be filled from the stock. The top card of the stock also is available to be played on foundations or built on tableau piles. After the stock is exhausted, tableau spaces may be filled from the talon and the player may keep them open until he wishes to use them. Cards are dealt from the hand to the talon by threes and this repeats until there are no more cards in the hand or the player quits. To have cards dealt onto the talon the player types 'ht' for his move. Foundation base cards are also automatically moved to the foundation when they become available. The command 'c' causes canfield to maintain card counting statistics on the bottom of the screen. When properly used this can greatly increase one's chances of winning. The rules for betting are somewhat less strict than those used in the official version of the game. The initial deal costs $13. You may quit at this point or inspect the game. Inspection costs $13 and allows you to make as many moves as possible without moving any cards from your hand to the talon. (The initial deal places three cards on the talon; if all these cards are used, three more are made available.) Finally, if the game seems interesting, you must pay the final installment of $26. At this point you are credited at the rate of $5 for each card on the foundation; as the game progresses you are credited with $5 for each card that is moved to the foundation. Each run through the hand after the first costs $5. The card counting feature costs $1 for each unknown card that is identified. If the information is toggled on, you are only charged for cards that became visible since it was last turned on. Thus the maximum cost of information is $34. Playing time is charged at a rate of $1 per minute. With no arguments, the program cfscores prints out the current status of your canfield account. If a user name is specified, it prints out the status of their canfield account. If the -a flag is specified, it prints out the canfield accounts for all users that have played the game since the database was set up. FILES
/usr/games/canfield the game itself /usr/games/cfscores the database printer /var/games/cfscores the database of scores BUGS
It is impossible to cheat. AUTHORS
Originally written: Steve Levine. Further random hacking by: Steve Feldman, Kirk McKusick, Mikey Olson, and Eric Allman. BSD
May 31, 1993 BSD
All times are GMT -4. The time now is 05:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy