11-28-2011
As a start:
- 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).
- There may be no space between the = and the value or command of a variable.
- If you start a while-loop, you got to close the "do" with "done".
- Same for case - you got to close it with "esac".
- 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
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
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
#!/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
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
# 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
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
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
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
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
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
LEARN ABOUT CENTOS
ttk::menubutton
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)