Sponsored Content
Full Discussion: How to reverse output?
Top Forums Shell Programming and Scripting How to reverse output? Post 302275731 by cfajohnson on Monday 12th of January 2009 03:13:46 AM
Old 01-12-2009

Some systems have a command, tac, that does what you want. If not, you can do it with:

Code:
awk '{ x = $0 "\n" x } END { printf "%s", x }'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reverse *

when I do $ ls z* List of all files begining with 'z'. But what if I want to do a reverse lookup. Just for interest sake ;) $ ls ztr should be same as $ ls ztr* $ ls zt* $ ls z* (2 Replies)
Discussion started by: azmathshaikh
2 Replies

2. Linux

Reverse Proxy

I have configured reverse proxy through apache...conf file is attached My reverse proxy has a public ip.it is redirecting the request to 172.16.1.43 which is http server.....Now i have a link in Http server's home page which will redirect the request to another Lan zone machine... (0 Replies)
Discussion started by: dipanrc
0 Replies

3. Shell Programming and Scripting

reverse sort

Hello, How do i sort a csv file. i should be sorting column1(varchar),column2*(varchar) in ascending and column4 in descending order(numeric datatype). I tried few combinations of sort, but doesn't seem to be getting the right result. sort -t "," -k 1 -k 2 -k 4nr file any help is... (3 Replies)
Discussion started by: markjason
3 Replies

4. Shell Programming and Scripting

Reverse lookup

hey guys, can anybody help me out here on the following: grep '^\{1,3\}\.\{1,3\}\.\{1,3\}\.\{1,3\}$' ravi.txt mary.txt lisa.txt https://www.unix.com/images/misc/progress.gif i.e what i did was found ip addreses from different files and then i want... (1 Reply)
Discussion started by: ravis83
1 Replies

5. Shell Programming and Scripting

how to reverse file

i am using AIX -ksh how can i reverse any file ,i have already try tac cmd it is not in AIX: please help me out. (3 Replies)
Discussion started by: RahulJoshi
3 Replies

6. Shell Programming and Scripting

Reverse the output using for loop

Good morning!! Im trying to ge tthe output in this for loop to be reversed. #!/usr/bin/perl $i = 1; for($i != 0 ; $i < 11 ; $i++){ print "$i\n"; } Ive tried changing the i++ to i--, but it makes the outputted numbers different also. Thanks bigben (4 Replies)
Discussion started by: bigben1220
4 Replies

7. Shell Programming and Scripting

Reverse of a string

Hi All, I have a String str="Manish". I would like to reverse it. I know the option to do this in bash is: echo "Manish" | rev but I have seen an alternate solution somewhere, which states that: str="Manish" echo $str | awk '{ for(i=length($0);i>=1;i--) printf("%s",substr($0,i,1));... (7 Replies)
Discussion started by: manishdivs
7 Replies

8. Shell Programming and Scripting

Reverse sort

Hello, I have a large list of names and would like to do a reverse sort on them i.e. the sort should be by the ending and not by the beginning of the word. I had written in awk a small script but it does wrong things { for(i=length($0);i>=1;i--) printf("%s/n",substr($0,i,1)); } Could anyone... (3 Replies)
Discussion started by: gimley
3 Replies

9. Shell Programming and Scripting

Reverse even lines

I'm trying to reverse every even line in my file using the awk command below but it prints only the odd lines but nothing else: $ awk '(NR % 2) {print}; !(NR % 2) {print | "rev";}' myfile Any idea what I might have done wrong? Thank you. (10 Replies)
Discussion started by: ivpz
10 Replies

10. UNIX for Dummies Questions & Answers

Reverse complement

I want to reverse some DNA sequences and complement them at the same time. Thus, A changes to T; C to G; T to A and G to C. example: infile >GHL8OVD01CMQVT SHORT1 TTGATGT >GHL8OVD01CMQVT SHORT2 TTGATGT outfile: >GHL8OVD01CMQVT SHORT1 ACATCAA >GHL8OVD01CMQVT SHORT2 ACATCAA The... (4 Replies)
Discussion started by: Xterra
4 Replies
REVNETGROUP(8)							 Reference Manual						    REVNETGROUP(8)

NAME
revnetgroup - generate reverse netgroup data SYNOPSIS
/usr/lib/yp/revnetgroup [-u|-h] DESCRIPTION
Revnetgroup processes the standard input in netgroup(5) format into what is called reverse netgroup form. That is, where the original file shows netgroup memberships in terms of which members reside in a particular group, the reverse netgroup format specifies what groups are associated with a particular member. This information is used to generate the netgroup.byuser and netgroup.byhosts NIS maps. These reverse netgroup maps are used to help speed up netgroup lookups, particularly for the innetgr library function. The revnetgroup command prints its results on the standard output. It is usually called only by /var/yp/Makefile when rebuilding the NIS netgroup maps. OPTIONS
The revnetgroup command supports the following options: -u Generate netgroup.byuser output; only username information in the original netgroup file is processed. -h Generate netgroup.byhost output; only hostname information in the original netgroup file is processed. Note at least one of the both flags must be specified. FILES
/var/yp/Makefile The Makefile to build the NIS databases /etc/netgroup the default netgroup database file. This file is most often found only on the NIS master server SEE ALSO
getnetgrent(3), netgroup(5), AUTHOR
revnetgroup was written by Thorsten Kukuk <kukuk@suse.de>. YP Server August 2001 REVNETGROUP(8)
All times are GMT -4. The time now is 08:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy