12-13-2007
no, there's not. but you can emulate it.
gawk 3.1.3+ does support switch/case though.
Last edited by vgersh99; 12-13-2007 at 09:44 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i'm new to shell scripting and have a problem please help me
in the script i have a nawk block which has a variable count
nawk{
.
.
.
count=count+1
print count
}
now i want to access the value of the count variable outside the awk block,like..
s=`expr count / m`
(m is... (5 Replies)
Discussion started by: saniya
5 Replies
2. Shell Programming and Scripting
Is it possible to make the search in regular exprecion or in matching parts of sed, nawk and others to IGNORE the case of the search string?
I mean, like if used 'grep' with -i option:
> grep -i "abc" file
I would like to be able to do the same, say, by nawk:
> nawk '/abc/ {print $0}'... (4 Replies)
Discussion started by: alex_5161
4 Replies
3. Shell Programming and Scripting
Hello
I have facing issue while using cp command inside nawk block.
#!/bin/ksh
my_name=$1
nawk -v my_name1=$my_name 'BEGIN {
n = split(my_name1,names,":");
for (i=1;i<=n;i++)
{
print names;
cpcmd = "cp " /tmp/test.txt" " ./sample
system(cpcmd)
}
exit
}'
exit 0
i'am getting... (1 Reply)
Discussion started by: piscean_n
1 Replies
4. Shell Programming and Scripting
Hi Jim,
The following script is in working state. But i m having one more problem with awk cmd. Could you tell me how to use any variable inside awk or how to take any variable value outside awk.
My problem is i want to maintain one property file in which i am declaring variable value into that... (12 Replies)
Discussion started by: Ganesh Khandare
12 Replies
5. Shell Programming and Scripting
HI,
My file contains data something like
034500,5,B5004946544EB185,DEFAULT,0
Now i want to do a pettern match for DEFAULT and remove that particular line from file and transfer the rest contents to temp file.But my req is i want to do case insensitive matching ie DEFAULT / default.
I... (4 Replies)
Discussion started by: centurion_13
4 Replies
6. Shell Programming and Scripting
Hi friends,
I have small query with reg to awk search pattern..
below is my sample file and code which i tried..
$ cat file.txt
xxx,yyyyy,messageID,sha
xxxx,errorcode,messageID,name
in the above sample file - let assume I know the errorcode(2nd record) using which I want to... (2 Replies)
Discussion started by: Shahul
2 Replies
7. Shell Programming and Scripting
please let me know if the below code could be written efficiently inside single awk
case "$INP" in
ksh)
cat catalog | awk 'BEGIN {FS=",";} { print $2 } END {}'
;;
pset)
cat catalog | awk 'BEGIN {FS=",";} { print $3 } END {}'
;;
dml)
cat catalog | awk 'BEGIN {FS=",";} {... (2 Replies)
Discussion started by: cvsanthosh
2 Replies
8. Shell Programming and Scripting
below is the output xml string from some other command and i will be parsing it using awk
cat /tmp/alerts.xml
<Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Discussion started by: vivek d r
2 Replies
9. Shell Programming and Scripting
Hi,
I need to set "prd" in the below command to a unix variable
nawk '/^#/ {next} FNR==NR {prd;next} !($0 in prd)'
So, this is what i did
fname=prd // unix shell variable
nawk -v fname=$fname '/^#/ {next} FNR==NR {fname;next} !($0 in fname)'But the value of fname i.e "prd" is not... (8 Replies)
Discussion started by: mohtashims
8 Replies
10. UNIX for Beginners Questions & Answers
Hi,
Here is my command
print $2 was meant to select the second column however, it is getting substituted with the second argument that was passed to the script.
Can you please tell me how can I resolve this ? (6 Replies)
Discussion started by: mohtashims
6 Replies
LEARN ABOUT DEBIAN
im-switch
IM-SWITCH(8) System Manager's Manual IM-SWITCH(8)
NAME
im-switch - set up input method for X Window
SYNOPSIS
im-switch [-v][-z ll_CC] -s inputmethodname
im-switch [-v][-z ll_CC] -c
im-switch [-v][-z ll_CC] -a
im-switch [-v][-z ll_CC] -l
im-switch -h
im-switch
DESCRIPTION
This manual page very briefly documents the im-switch command.
The im-switch command provides the framework to configure and to switch the input method on X Window System depending on the locale. This
input method is the essential mechanism for Japanese, Chinese and Korean (CJK) languages to enter their non-ASCII native characters.
Some input methods such as IBus, SCIM, and uim support not only one of these CJK languages but support almost all languages simultaneously
by dynamically switching keyboard modes with GUI.
The most desirable input method is provided as the configurable system wide default using Debian alternatives mechanism with /etc/alterna-
tives/xinput-ll_CC link.
The X start up code sources /etc/X11/Xsession.d/90im-switch which read the configuration file and activates the input method. The user
configuration files and links are located in ~/.xinput.d/ . The system configuration files and links are located in /etc/X11/xinit/xin-
put.d/ .
This structure ensures to have different input methods to be installed side-by-side.
im-switch understands the following options:
-v Display verbose message during execution.
-z ll_CC
Set up the input method for X run under ll_CC locale (ISO 639 / ISO 3188). When changing the fallback default for all locales, use
all_ALL as the quasi-locale value here. The setup by this all_ALL does not override specific setups.
-s inputmethodname
Set up the input method to use inputmethodname.
-c Configure the input method with menu. (Under X, this uses GUI.)
-a Reset the input method to the system default.
-l List the input method configuration.
-h Print a help message to the standard output and exit.
When the im-switch command is invoked without any command arguments, it functions as -c option case. This is meant to be used by the GUI
menu.
SEE ALSO
update-alternatives(8) /usr/share/doc/im-switch/README.Debian /etc/X11/xinit/xinput.d/default
AUTHOR
This manual page was written by Osamu Aoki <osamu@debian.org>, for the Debian GNU/Linux system (but may be used by others).
IM-SWITCH(8)