10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have identified how to use command chaining as per below on a file, to capture the header of a file, as well as the line containing the C: drive.
$ cat test.txt
Filesystem Size Used Avail Use% Mounted on
rootfs 237G 153G 84G 65% /
none 237G 153G 84G ... (6 Replies)
Discussion started by: sand1234
6 Replies
2. Shell Programming and Scripting
Hi,
I am running a script sample.sh in bash environment .In the script i am using sed and awk commands which when executed individually from terminal they are getting executed normally but when i give these sed and awk commands in the script it is giving the below errors :-
./sample.sh: line... (12 Replies)
Discussion started by: satishmallidi
12 Replies
3. Shell Programming and Scripting
Hi,
I've been trying to dig myself out of this, but nothing has worked out yet.
I have an input like this:
1-Num1
1-Num2
2-Num3
3-Num4
1-Num5
3-Num11
2-Num11
1-Num13
1-Num16
3-Num18
4-Num19
2-Num20
1-Num22
3-Num23 (11 Replies)
Discussion started by: jamie_123
11 Replies
4. Shell Programming and Scripting
I would like to calculate
1/n
In awk, I wrote the following line for the sigma summation:
{ summ+=($1-average)^2 }
Full code:
BEGIN { Print "This script calculate error estimates"; sum=0 }
{ sum+=$1; n++ }
END { average = sum/n }
BEGIN { summ=0 }
{ summ+=($1-average)^2 }
END { print... (8 Replies)
Discussion started by: chrisjorg
8 Replies
5. Shell Programming and Scripting
I've run into a problem getting exactly what I want out of awk - some folks may recognize this as an output from Amazon's ec2-describe-instances:
Given the following:
INSTANCE i-4960f321
BLOCKDEVICE Line2Var2
TAG instance i-4960f321 Name web1
TAG instance i-4960f321... (2 Replies)
Discussion started by: colinjohnson
2 Replies
6. Shell Programming and Scripting
Hello everyone, I've suddenly gotten very interested in sed and awk (and enjoying it quite a bit too) because of a large conversion project that we're working on. I'm currently stuck with a very inefficient process for processing text blocks. I'm sure someone here should be able to easily point out... (2 Replies)
Discussion started by: jameswatson3
2 Replies
7. Shell Programming and Scripting
Hi everybody,
I am working on a bigger awk script in which one part is comparing the size of two files.
I want to evaluate which file is bigger and then just save the bigger one.
I got it all working except for the part where I want to figure out which file is bigger; the one awk is currently... (2 Replies)
Discussion started by: iMeal
2 Replies
8. Shell Programming and Scripting
Hi, I need to grep a pattern and fetch subsequent lines till end of the data-set.
E.g., i have a file like:
AA 1111 23 34
BB 45 56 78
CC 22 44
AA 2222 78 34 56
BB 22 56 67 68 23
CC 56 78
DD 33 55 77
AA 3333 46
BB 58 79
In above file i have 3-data sets where each set starts with... (6 Replies)
Discussion started by: prvnrk
6 Replies
9. Shell Programming and Scripting
Hi all,
I am looking for a coomand to search for the keywords in susequenct lines. Keyword1 in a line and Keyword2 in the very next line.
Once i found the combination ineed to print the lines with patterns and the line above and one below.
I am giving an example here: Keywords are :ERROR and... (12 Replies)
Discussion started by: rdhanek
12 Replies
10. Shell Programming and Scripting
Hi all,I am really new to Shell Scripting.I have the following doubt.
Let us assume the one sample file which contains the below data
HEADERCARMENTRACIE1555090414
PERIOD0905090501090531
DETAIL0645693037023073836
GROUNDAV 090501 01
GROUNDAV 090502 01
TRIP 0091282542 0905084101... (5 Replies)
Discussion started by: jaligamasriniva
5 Replies