10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Dear forum members,
I want the script to count ALA as one (an example in quotes) and return an integer as 1 and not return 5 as an integer as it does now (look bash script). So how can I upgrade my script that it first checks or after finding all instances of ALA checks whether it is the same... (25 Replies)
Discussion started by: Aurimas
25 Replies
2. UNIX for Beginners Questions & Answers
Hello,
Giving those commands:
cat > myfile
1
2
3
^D
cat myfile | awk '{ s=s+$1 ; print s}'
The output is:
1
3
6
It seems like this command iterates each time on a different row so $1 is the first field of each row.. But what caused it to refer to each row ?.
What I mean... (3 Replies)
Discussion started by: uniran
3 Replies
3. Emergency UNIX and Linux Support
Hi! all here is my code
which is working fine no errors but I want to know how to take result and input to other program
awk 'FNR==1{i++}{LC=NR}
{for(k=1; k<=NF; k++) A=$k}
END{for (i=1;i<=LC;i++)
{
for(j=1;j<=LC;j++)
if(A=='$UID' && A>='$MX'+A &&... (7 Replies)
Discussion started by: Akshay Hegde
7 Replies
4. UNIX for Advanced & Expert Users
I don't the following why ?:confused:
$ awk 'BEGIN{printf "%.40f\n",(0.33*3)}'
0.9899999999999999911182158029987476766109
$ awk 'BEGIN{printf "%.4f\n",(0.33*3)}'
0.9900 (0 Replies)
Discussion started by: saloman
0 Replies
5. UNIX for Dummies Questions & Answers
I don't the following why ?:confused:
$ awk 'BEGIN{printf "%.40f\n",(0.33*3)}'
0.9899999999999999911182158029987476766109
$ awk 'BEGIN{printf "%.4f\n",(0.33*3)}'
0.9900 (0 Replies)
Discussion started by: saloman
0 Replies
6. Shell Programming and Scripting
Hi,
I have data as
"01/22/97-"aaaaaaaaaaaaaaaaa""aaa""aabbbbbbbbcccccc""zbcd""dddddddddeeeeeeeeefffffff"
I want to remove only the Consequitive double quotes and not the one which occurs single.
My O/P must be ... (2 Replies)
Discussion started by: Bhuvaneswari
2 Replies
7. Shell Programming and Scripting
Hi folk,
Hope you enjoy the summer.
I am stock after one day working, the problems are the following:
1) I want to write a for loop in a shell script code that has a double precision step as:
#!/bin/bash
START=0.00001
STOP=0.001
for((i = START ; i< STOP ; i=2*i)) do
echo "$i"... (1 Reply)
Discussion started by: habib
1 Replies
8. HP-UX
I was wondering if it was possible to tell awk to print the output of a command in the print.
.... | awk '{print $0}'
I would like it to print the date right before $0, so something like (this doesn't work though)
.... | awk '{print date $0}' (4 Replies)
Discussion started by: IMTheNachoMan
4 Replies
9. Shell Programming and Scripting
Hi,
i am using the command
find . -exec grep -i "sometexttofoundinfiles" '{}' \; -print
The problem with this command is it prints the path of file i want twice. I did try the "-q" option of the grep command. It generates an error "invalid option". i guess the shell i am using... (1 Reply)
Discussion started by: silas.john
1 Replies
10. Shell Programming and Scripting
Hi,
I have a log file that has the date in this format "2006-05-30_13:14:04,256". I need to find the time difference between two log entries in milliseconds.
How to achieve this in AWK/GAWK script? :confused: (2 Replies)
Discussion started by: omprasad
2 Replies