Sponsored Content
Full Discussion: menu + awk + while + case
Top Forums UNIX for Dummies Questions & Answers menu + awk + while + case Post 302577246 by zaxxon on Monday 28th of November 2011 12:50:17 PM
Old 11-28-2011
As a start:
  1. Assigning the output of a command to a variable needs the command(s) on the right side of the = either enclosed inside backticks `command` or this $(command).
  2. There may be no space between the = and the value or command of a variable.
  3. If you start a while-loop, you got to close the "do" with "done".
  4. Same for case - you got to close it with "esac".
  5. Single entries for case are ended with double semicolon ;;.

After this, try again and check your errors, read them and try to fix them. Some error messages just explain what is going wrong.
Also have a look at a scripting introduction/guide so you get some basic knowledge.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk case-insensitive

can I tell awk to be case insensitive for one operation without setting the ignorecase value ? thanks, Steffen (7 Replies)
Discussion started by: forever_49ers
7 Replies

2. Shell Programming and Scripting

Clear Case, Awk and script

Hello. I should have asked this awhile ago but here is my situation. My task is to generate LOC for different directories. I have a text file that has dates in this format (01-Aug-2006). My task is to read each line and compare it to a branch date. Depending on the date, it should generate a... (0 Replies)
Discussion started by: mastachef
0 Replies

3. Shell Programming and Scripting

what the awk do in this case

#!/bin/sh nowpwd=`pwd` cd $VAMPIRE_HOME configFile=$VAMPIRE_CFG/vampire.cfg inpuFileName=`awk -F\= '{ if ($1 == "PrepFilePos.InpFilePosDepo") { printf("%s",$2) exit 0 }}' < $configFile` I need to know what the awk doing here and what is the expected result here... (1 Reply)
Discussion started by: habuzahra
1 Replies

4. Shell Programming and Scripting

case-insensitive search with AWK

Hi All, How we can perform case-insensitive search with AWK.:rolleyes: regards, Sam (11 Replies)
Discussion started by: sam25
11 Replies

5. Shell Programming and Scripting

awk maintain case query

# Print list of word frequencies { $0 = tolower($0) for (i = 1; i <= NF; i++) counter++ } END { for (word in counter) printf "%s\t%d\n",word, counter } I have this simple awk code from awk user guide to count the frequency of word. Now consider the... (7 Replies)
Discussion started by: ajacobs365
7 Replies

6. Shell Programming and Scripting

Two columns output in simple case menu?

EDIT : System used : Any Linux distribution. Hello everyone, I m having quite a headache trying to figure out why I m having a 2 columns output in the following code : #!/bin/ksh menu_rotation() { #Variables CHOIX1="Rotation 1" CHOIX2="Rotation 2" CHOIX3="Rotation 3" ... (11 Replies)
Discussion started by: Sekullos
11 Replies

7. Shell Programming and Scripting

Need help in create menu with 3 sub menu using the case command

hi all i am a newbie to this is there any examples on creating a main menu with 3 sub menu main menu -> option a , b and c a menu -> option 1 ,2 and 3 b menu -> option 1 ,2 c menu -> option 1 ,2 i am getting headache as my code kept getting unexpected EOF ---------- Post... (0 Replies)
Discussion started by: chercm
0 Replies

8. 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

9. Shell Programming and Scripting

Special case to skip function in bash menu

In the bash menu below if the variant that is inputted is in the format NM_004004.3:c.274G>T the below works perfectly. My question is if the variant inputted isNM_004004.3:-c.274G>T or NM_004004.3:+c.274G>T then the code as is will throw an error due to a biological issue. Is it possible to to... (1 Reply)
Discussion started by: cmccabe
1 Replies

10. UNIX for Beginners Questions & Answers

Gnome 3.28.3 menu item dissapears under the system menu

I installed CentOS 8 with Gnome 3.28.2 and I noticed that the "switch user" menu item disappeared from under the system menu of Gnome classic (Both X11 & Wayland). I checked google and this problem seems to have a history going back several releases of Gnome. Unfortunately, I never found a... (1 Reply)
Discussion started by: bodisha
1 Replies
ttk::menubutton(n)						 Tk Themed Widget						ttk::menubutton(n)

__________________________________________________________________________________________________________________________________________________

NAME
ttk::menubutton - Widget that pops down a menu when pressed SYNOPSIS
ttk::menubutton pathName ?options? _________________________________________________________________ DESCRIPTION
A ttk::menubutton widget displays a textual label and/or image, and displays a menu when pressed. STANDARD OPTIONS
-class -compound -cursor -image -state -style -takefocus -text -textvariable -underline -width See the ttk_widget manual entry for details on the standard options. WIDGET-SPECIFIC OPTIONS [-direction direction] Specifies where the menu is to be popped up relative to the menubutton. One of: above, below, left, right, or flush. The default is below. flush pops the menu up directly over the menubutton. [-menu menu] Specifies the path name of the menu asso- ciated with the menubutton. To be on the safe side, the menu ought to be a direct child of the menubutton. WIDGET COMMAND
Menubutton widgets support the standard cget, configure, identify, instate, and state methods. No other widget methods are used. STANDARD STYLES
Ttk::menubutton widgets support the Toolbutton style in all standard themes, which is useful for creating widgets for toolbars. SEE ALSO
ttk::widget(n), menu(n), menubutton(n) KEYWORDS
widget, button, menu Tk 8.5 ttk::menubutton(n)
All times are GMT -4. The time now is 09:53 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy