Sponsored Content
Top Forums Shell Programming and Scripting Print various rows in one row Post 302823177 by RudiC on Wednesday 19th of June 2013 02:50:46 AM
Old 06-19-2013
Try also
Code:
awk '{gsub (/[][]/,""); print "alias "$1"=\047ssh "$3"@"$2"\047"}' RS="" file
alias server.domain.com='ssh yyyyyyuser@11.22.33.44'

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenate 2 rows into 1 row

I need to search a file for two values (valueA & valueB). ValueA will be on a different row than valueB, and concatenate the two together on the same row of my output. Example: search input file for strings "node" and "OS", combine the two results into one row input node A text text OS... (4 Replies)
Discussion started by: indianadoug
4 Replies

2. Shell Programming and Scripting

Insert rows with computations of next row

Hello folks, I have data collected in every 3 hours. But, I would like to expand this to 1 hour interval by equally dividing with next row. For example, I want to keep the first value 1987-01-01-00z 2.0, but following all record should be re-written as follow. 1987-01-01-03z 5.0 becomes... (11 Replies)
Discussion started by: Jae
11 Replies

3. UNIX for Advanced & Expert Users

convert rows to single row

Hi I want to convert multiple rows ro single row ,I have tried with below one but I am not getting what I am expecting.Please any idea a.txt conn1=stg conn2=dev path=\xxx\a1.txt fre=a conn1=stg conn2=dev path=\xxx\a2.txt freq=a awk '/a/{ORS=" "}{print}END{print "\n"}'... (5 Replies)
Discussion started by: akil
5 Replies

4. UNIX for Advanced & Expert Users

Converting rows to a single row

Hi all I have a file as below : Development System User Production i want to convert the file to below format: "Development","System","User","Production" Is it possible with UNIX ? if so can you please give me some direction on it ? Thanks, Satya Use code tags please, ty. (10 Replies)
Discussion started by: satyaranjon
10 Replies

5. UNIX for Dummies Questions & Answers

search one row and print next 9 rows

Hi, I'd like your support on this, my file looks like this: 25 50 200 10 0 1 10 6 12 17 26 24 30 319 10 -0.83 3.31 270.646 12.48 -163.04 30.38 0 0 0 -2.88 0.64 16.06 34.4 33.08 34.4 33.08 34.06 20.48 6.22 -33.39 33.96 -33.5840381 -71.6177759 -163.26 25.59 34.1 -28.8 -5.6 -9.9 0 0 0 0... (3 Replies)
Discussion started by: Gery
3 Replies

6. Shell Programming and Scripting

complicated row to rows conversion

I have a file containing rows with the following format. Field1|Field2|Field3|data1:data data2:data data3:"dataA:data dataB:data" data4:data:data (and so on) I need to format the above row into multiple rows that look like this: Field1|Field2|Field3|data1|data ... (2 Replies)
Discussion started by: newreverie
2 Replies

7. Shell Programming and Scripting

Get row number from file1 and print that row of file2

Hi. How can we print those rows of file2 which are mentioned in file1. first character of file1 is a row number.. for eg file1 1:abc 3:ghi 6:pqr file2 a abc b def c ghi d jkl e mno f pqr ... (6 Replies)
Discussion started by: Abhiraj Singh
6 Replies

8. Shell Programming and Scripting

Print row on 4th column to all row

Dear All, I have input : SEG901 5173 9005 5740 SEG902 5227 5284 SEG903 5284 5346 SEG904 5346 9010 SEG905 5400 5456 SEG906 5456 5511 SEG907 5511 9011 SEG908 5572 9015 SEG909 5622 9020 SEG910 5678 5739 SEG911 5739 5796 SEG912 5796 9025 ... (3 Replies)
Discussion started by: attila
3 Replies

9. Shell Programming and Scripting

Splitting single row into multiple rows based on for every 10 digits of last field of the row

Hi ALL, We have requirement in a file, i have multiple rows. Example below: Input file rows 01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212 01,1,102319,0,1,80,20,U,1,241,00000059420000006021 I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Discussion started by: kotra
4 Replies

10. Shell Programming and Scripting

Reseting row count every given number of rows

I have a file with 48 rows. I am counting 6 rows and adding 6 to that number and repeating the operation, and then output the value in column 1. For the second column, I would like to get sort of a binary output (1s and 2s) every 3rd row. This is what I have: awk '{print ++src +... (1 Reply)
Discussion started by: Xterra
1 Replies
aliasadm(1M)						  System Administration Commands					      aliasadm(1M)

NAME
       aliasadm - manipulate the NIS+ aliases map

SYNOPSIS
       aliasadm -a alias expansion [options comments] optional flags

       aliasadm -c alias expansion [ options comments] [ optional flags]

       aliasadm -d alias [ optional flags]

       aliasadm -e alias [ optional flags]

       aliasadm -l alias [ optional flags]

       aliasadm -m alias [ optional flags]

       aliasadm [-I] [-D domainname] [-f filename] [-M mapname]

DESCRIPTION
       aliasadm makes changes to the alias map.

       The alias map is an NIS+ table object with four columns:

       alias	       The name of the alias as a null terminated string.

       expansion       The value of the alias as it would appear in a sendmail /etc/aliases file.

       options	       A  list	of options applicable to this alias.  The only option currently supported is  CANON. With this option, if the user
		       has requested an inverse alias lookup, and there is more than one alias with this expansion, this alias	is  given  prefer-
		       ence.

       comments        An  arbitrary  string  containing comments about this alias. The sendmail(1M) command reads this map in addition to the NIS
		       aliases map and the local  /etc/aliases database.

OPTIONS
       -a	       Add an alias.

       -c	       Change an alias.

       -d	       Delete an alias.

       -e	       Edit the alias map.

       -I	       Initialize the NIS+ aliases database.

       -l	       List the alias map.

       -m	       Print or match an alias.

       -D domainname   Edit the map in domain  domainname instead of the current domain.

       -f filename     When editing or listing the database, use filename instead of invoking the editor.

       -M mapname      Edit mapname instead of mail_aliases.

FILES
       /etc/aliases    mail aliases for the local host in ASCII format

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       +-----------------------------+-----------------------------+
       |      ATTRIBUTE TYPE	     |	    ATTRIBUTE VALUE	   |
       +-----------------------------+-----------------------------+
       |Availability		     |SUNWnisu			   |
       +-----------------------------+-----------------------------+

SEE ALSO
       sendmail(1M), attributes(5)

NOTES
       NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from  NIS+  to  LDAP  are
       available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html.

SunOS 5.10							    12 Dec 2001 						      aliasadm(1M)
All times are GMT -4. The time now is 01:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy