Good Moring, I am currently reading about awk in a manual and following the examples using the oratab file. My system is SOLARIS 10 I think I am getting strange behavior judging by what the book says to do and what I am getting with my little program. Here is my program: sample from oratab: Before parsing. EXPECTED OUTPUT:
But my actual is:
ACTUAL OUTPUT:
It appears that something has shifted and I can’t figure out what is wrong with my syntax in the original statement.
I did the following print and the output is below it.
FIELD $0: suppose to return the entire string ex. tsaimx:/oracle/product/11.2.0/dbhome_3:Y but doesn’t. It returns the correct information but in reverse order: field $3 then $1. It should be the other way around.
This should have printed out all 3 fields but doesn’t. Only field 1 and 3 are printed and they are also printed in reverse order.
This command prints the field that is NOT LISTED in the print command !!! It prints field number 1.
record: tsaimx:/oracle/product/11.2.0/dbhome_3:Y
Why isn’t my program working as expected?
Any help on this matter would be appreciated.
thanks in advance
Moderator's Comments:
Please STOP using SIZE and FONT tags on every line you post. And, please use CODE tags for sample input, output, and code segments. CODE tags need to be used as in:
[CODE]sample input, sample output, and sample code[/CODE]
which will display as:
[CODE][/CODE]sample input, sample output, and sample code[CODE][/CODE] will not work.
Last edited by Don Cragun; 02-06-2015 at 02:24 PM..
Reason: Remove hundreds of FONT and SIZE tags; add CODE and ICODE tags.
Hi,
I am new to C and have a little problem.
I am not planning to be a C expert, but this would be nice to understand.
The problem is that a 'system' call prints it output to stdout, when I do not expect this.
This is the program:
trial.c
#include <ctype.h>
#include <unistd.h>... (5 Replies)
Hi,
I am presently stuck in a csv file.
INPUT CSV
baseball,NULL,8798765,Most played
baseball,NULL,8928192,Most played
baseball,NULL,5678945,Most played
cricket,NOTNULL,125782,Usually played
cricket,NOTNULL,678921,Usually played
EXPECTED OUTPUT CSV
... (7 Replies)
Hi All,
I am in middle of one script. I want output in the form of xls file.
There are 4 fields - user name, email Id, full name, date of birth. I want these details to get in seperate columns.
But, i am getting it in the single cell and as like a paragraph.:mad:
Please suggest me some... (8 Replies)
Hi
I have written below script to get the data in table form.
#!/bin/sh
echo "File Name\tType"
for i in *;
do
echo "$i\t\c"
if ; then
echo "directory"
elif ; then
echo "symbolic link"
elif ; then
echo "file"
else
echo "unknown"
fi
donehowever i am getting output in different way... (3 Replies)
I've been working on improving my awk, and the next thing I want to learn is to properly use functions (I understand functions in shell and python). I have the following code which includes how I did this without functions before, and two attempts I've made to do it with functions:
function... (3 Replies)
Hello,
I am trying to print out the first string matching query with grep and I need your help.
My scenario:
Database
John F
4433 Street No 88 CA
Elisabeth Taylor
7733 Street No 26 ON
Jack Nicholson
0133 Green Park No 34 AR
John F 2
9399 Southpark No 02D UT
test.sh... (6 Replies)
Hello,
I am practising awk and decided to compare two columns and print the result of the comparison as third column
i/p data
c1,c2,c3
1,a,b
1,b,b
i am trying to compare the last two columns and if they match I am trying to print match else mismatch(Ideally i want that as a last column... (5 Replies)
Hi Gurus,
I run command grep ABC file1 > file2 against below file. I got all ABC_xxx in one line in file2. I expect to get multiple lines in file2. If I print result in screen, the result is expected.
thanks in advance
My os is SunOS 5.10 Generic_150400-64 sun4v sparc sun4v
ABC_123
XXXXX... (2 Replies)