Sponsored Content
Top Forums Shell Programming and Scripting Don't understand how RS functions in awk Post 302449058 by rdcwayx on Saturday 28th of August 2010 06:17:16 AM
Old 08-28-2010
default RS is "\n" or new line, it used to separate the records . So by default, each line is a record.

if RS="", then use the empty line as record separater.
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

don't understand the unix script

if {"$my_ext_type" = MAIN]; then cd $v_sc_dir Filex.SH $v_so_dir\/$v_fr_file Can somebody tell me what does this suggest. I am pretty new to unix and I am getting confused. What i understood from here is If we have a file extension name as MAIN which we have then we change the directory to... (1 Reply)
Discussion started by: pochaman
1 Replies

2. Homework & Coursework Questions

I don't understand some basics..

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: 1)find all lines in file ,myf that contain all the words cat dog and mouse in any order and start with the letter... (1 Reply)
Discussion started by: cudders
1 Replies

3. UNIX for Dummies Questions & Answers

Another Simple BASH command I don't understand. Help?

I have a text file called file1 which contains the text: "ls -l" When I enter this command: bash < file1 > file1 file1 gets erased. However if I enter this command: bash < file1 > newfile the output from "ls -l" is stored in newfile. My question is why doesn't file1's text ("ls -l") get... (3 Replies)
Discussion started by: phunkypants
3 Replies

4. Shell Programming and Scripting

Perl syntax that I don't understand.

I'm just trying to confirm that I understand someone's code correctly. If someone has code that says: $foo ||= mysub(); I'm assuming that it means if $foo is nothing or undef, then assign it some value via mysub(). If I'm wrong on this, please let me know. Also, what's the difference... (4 Replies)
Discussion started by: mrwatkin
4 Replies

5. UNIX for Dummies Questions & Answers

trying to compile and don't understand error message

this is my program i am trying to compile /* filedata -- display information about a file */ #include <stdlib.h> #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> /* * use octarray for determing * if permission bits set */ static short octarray = {0400, 0200, 0100,... (2 Replies)
Discussion started by: heywoodfloyd
2 Replies

6. UNIX for Dummies Questions & Answers

I don't understand conditions :(

Hi there, I have a very general question. I'm rather new to (bash) shell scripting and I don't understand how conditions work... I've read numerous tutorials but I don't get it. I really don't. Sometime what I do works, sometime it doesn't and that's frustating. So what's the actual difference... (0 Replies)
Discussion started by: hypsis
0 Replies

7. Programming

Understand Virtual functions Internals

I am just trying to understand the virtual fns. concept. I know that if I have a virtual fn. in a base class and its overridden fn. in derived class then based upon the address of base/derived object stored in the base class pointer the fns. will be called. In the below code I had kept... (2 Replies)
Discussion started by: rupeshkp728
2 Replies

8. Shell Programming and Scripting

Don't understand AWK asort behaviour

Hello, I have the following script : BEGIN { print "1 ***"; split("abc",T,""); T="e"; T="z"; T="y"; for (i in T) printf("%i:%s ",i,T); print ""; for (i=1; i<=length(T); i++) printf(T); print "" print "2 ***"; asort(T,U); for (i in U) printf("%i:%s ",i,U); ... (3 Replies)
Discussion started by: jgilot
3 Replies
RLAM(1) 						      General Commands Manual							   RLAM(1)

NAME
rlam - laminate records from multiple files SYNOPSIS
rlam [ -tS ][ -u ][ -iaN | -ifN | -idN | -iiN | -iwN | -ibN ] input1 input2 .. DESCRIPTION
Rlam simply joins records (or lines) from multiple inputs, separating them with the given string (TAB by default). Different separators may be given for different files by specifying additional -t options in between each file name. Note that there is no space between this option and its argument. If none of the input files uses an ASCII separator, then no end-of-line character will be printed, either. An input is either a stream or a command. Commands are given in quotes, and begin with an exclamantion point ('!'). If the inputs do not have the same number of lines, then shorter files will stop contributing to the output as they run out. The -ia option may be used to specify ASCII input (the default), or the -if option may be used to indicated binary IEEE 32-bit floats on input. Similarly, the -id and -ii options may be used to indicate binary 64-bit doubles or integer words, respectively. The -iw option specifies 2-byte short words, and the -ib option specifies bytes. If a number is immediately follows any of these options, then it indi- cates that multiple such values are expected for each record. For example, -if3 indicates three floats per input record for the next named input. In the case of the -ia option, no number indicates one line per input record, and numbers greater than zero indicate that many characters exactly per record. For binary input formts, no number implies one value per record. For anything other than EOL-separated input, the default tab separator is reset to the empty string. A hyphen ('-') by itself can be used to indicate the standard input, and may appear multiple times. The -u option forces output after each record (i.e., one run through inputs). EXAMPLE
To join files output1 and output2, separated by a comma: rlam -t, output1 output2 To join a file with line numbers (starting at 0) and its reverse: cnt `wc -l < lam.c` | rlam - -t: lam.c -t '!tail -r lam.c' To join four data files, each having three doubles per record: rlam -id3 file1.dbl file2.dbl file3.dbl file4.dbl > combined.dbl AUTHOR
Greg Ward SEE ALSO
cnt(1), histo(1), neaten(1), rcalc(1), tabfunc(1), total(1) RADIANCE
7/8/97 RLAM(1)
All times are GMT -4. The time now is 05:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy