10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
GOODNUMBERS="1 2 3 4 5 6 3 3 34 34 5 66 12"
BADNUMBERS="7 3 12 5 66"
for eachnum in `echo ${GOODNUMBERS}`
do
echo ${BADNUMBERS} | gawk -v threshold=${eachnum} '$1 != threshold'
done
what im trying to do with the above is, i want to print numbers that are in the GOODNUMBERS... (10 Replies)
Discussion started by: SkySmart
10 Replies
2. Shell Programming and Scripting
I need help in awk script to do contains search and my requirement is below
I need to check if the value in each column is present in any other column and print it. And in some columns these value could be existing with comma as delimiter.
Sample data... (6 Replies)
Discussion started by: aramacha
6 Replies
3. Shell Programming and Scripting
Hello,
Can anyone explain for me in this script to reverse the string?
1) the "x=x" part, how it works?
$ echo welcome | awk '{ for(i=length;i!=0;i--)x=x substr($0,i,1);}END{print x}'
$ emoclew2) x seems to be an array at the END, but can it automatically print the whole array in awk?
Thanks... (8 Replies)
Discussion started by: yifangt
8 Replies
4. Shell Programming and Scripting
How to reverse search for a matched string in a file. Get line# of the first matched line. I am getting '2' into 'lineNum' variable.
But it feels like I am using too many commands. Is there a better more efficiant way to do this on Unix?
abc.log
aaaaaaaaaaaaa
bbbbbbbbbbbbb... (11 Replies)
Discussion started by: kchinnam
11 Replies
5. Shell Programming and Scripting
I may be making this too hard on myself, but I'm trying to find a way that I can use a cut or awk string to always remove the last two delimited fields of a string.
Say I have
PackageName-U939393-8.2.3.4.s390x.rpm
But the s390x could be any string w/o periods in it, x8664 for example,... (9 Replies)
Discussion started by: cbo0485
9 Replies
6. Shell Programming and Scripting
I have a file which is
DFDG
START
DSFDS
DSDS
XXX
END (VIO)
AADD
START
SDSD
FGFG
END
and I have to print the lines between START and END (VIO). In the files there are multiple places where START would be followed by END with few lines in between but I need to print only if START is... (18 Replies)
Discussion started by: pgbuddy
18 Replies
7. Shell Programming and Scripting
Is it possible to convert EXONtoBED (Output to input)?
1. BEDtoExon.sh
-------------------
awk '{
n11 = split($11, t11, ",")
n12 = split($12, t12, ",")
for (i = 0; ++i < n11;) {
s12 = $2 + t12
print $1, s12, s12 + t11, i”E_”$4
}
}' $1
... (1 Reply)
Discussion started by: quincyjones
1 Replies
8. Shell Programming and Scripting
Hi all,
In a script like :
job_date=....
ls -l 2>/dev/null |
awk -v var =$job_date '
/Name\.Version\.+\.xml$/ {
How can i include a script variable job_date store in "var" in the pattern "/Name\.Version\.+\.xml$/"
Thanks in advance (12 Replies)
Discussion started by: abhinav192
12 Replies
9. Shell Programming and Scripting
Hi,
this is fantastic forum for shell programming and scripting,
so please let me to introduce you with my very old concept to
have web form/s with radio, select, input fields
and have an application generating valid, syntax error free scripting code.
The same or alike questions are asked... (2 Replies)
Discussion started by: darius2
2 Replies
10. Shell Programming and Scripting
Hello All,
I have a following task that I need to accomplish through a script or program and I am looking for some help as I have exhausted my ideas.
1. given: a text file with thousands of lines
2. find: pattern A in file and get line number ( grep -n works)
3. find: the first occurence of... (14 Replies)
Discussion started by: PacificWonder
14 Replies