10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Trying to do so
echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies
2. Shell Programming and Scripting
I wrote a very simple script to understand how to call user-defined functions from within awk after reading this post.
function my_func_local {
echo "In func $1"
}
export -f my_func_local
echo $1 | awk -F"/" '{for (k=1;k<=NF;k++) {
if ($k == "a" ) {
system("my_local_func $k")
}
else{... (19 Replies)
Discussion started by: sreyan32
19 Replies
3. Shell Programming and Scripting
I have a report that I'd like to print columns headers on. The code appears as follows:
gawk '{for (i=1; i<=NF; i++) if ($i < 0) $i = -$i; print }'|gawk '{ printf "%-78s%-30s%-30s%-30s\n", $1,$2, $3, $4 }' |awk '{for (i=1; i<=NF; i++) if ($i < 0) $i = -$i; print }' report_1020I am trying to make... (3 Replies)
Discussion started by: newbie2010
3 Replies
4. Shell Programming and Scripting
I am having a problem where the Compute field/column is spilling over to the new line. Here's the piece of code and the o/p:-
Code Sniplet:-
for id in `qstat -u "*" -q "$Queue" -s r |sed -n '3,$ p'|awk -F" " '{print $1}'`
do
NODELIST=`cat /scratch/$id.hostlist.*|awk -F" " '{print $1,$2}'|tr '... (5 Replies)
Discussion started by: grish
5 Replies
5. Shell Programming and Scripting
I have a data file like this:
49960 1157 32390 1227 1268
31 8 21
12 115 18493 67
250 2 2 237704 369658
52 21 312 38 27746 3174
19 160 9 555 6337 6071
43 33
I want to separate the field to three groups, $1 and $2 are the first group, $3 and $4 are the second group, $5 and $6... (1 Reply)
Discussion started by: xshang
1 Replies
6. Shell Programming and Scripting
Using ksh to call a function which has awk script embedded.
It parses a long two element list file, filled with text numbers (I want column 2, beginning no sooner than line 45, that's the only known thing) . It's unknown where to start or end the data collection, dynamic variables will be used. ... (1 Reply)
Discussion started by: highnthemnts
1 Replies
7. Shell Programming and Scripting
Hello all,
I am very new to the shell scripting and I hope someone can help me with this.
I have thousands of files with certain format of information and I need to do this for all my files.
For each file, grab the numbers in the first and second rows and place them in the position 1 and 2... (8 Replies)
Discussion started by: GoldenFire
8 Replies
8. Shell Programming and Scripting
A have a file
npt02-sr40-syn-dc0p014-32x24drw.log:0. Best Value = 0.00144914
npt02-sr40-syn-dc0p014-32x24drw.log:1. Best Value = 0.00115706
npt02-sr40-syn-dc0p014-32x24drw.log:2. Best Value = 0.00094345
npt02-sr40-syn-dc0p014-32x24drw.log:3. Best Value = 0.000925552... (11 Replies)
Discussion started by: kristinu
11 Replies
9. Shell Programming and Scripting
Hi all, I am new to the forum and Shell Script programming.
The problem is:
I need to do a script to search all system processes and show me hierarchical way the number of bytes occupied by each of the regions of the memory map of each process.
Today I got to show me the number of regions in... (3 Replies)
Discussion started by: cougar_rea
3 Replies
10. Shell Programming and Scripting
I have a large file which reads like this:
fixed-address 192.168.6.6 {
hardware ethernet 00:22:64:5b:db:b1;
host X;
}
fixed-address 192.168.6.7 {
hardware ethernet 00:22:64:5b:db:b3;
host Y;
}
fixed-address 192.168.6.8 {
hardware ethernet 00:22:64:5b:db:b4;
host A;
}... (4 Replies)
Discussion started by: ksk
4 Replies