Cynosure.X International LLC

: :

Add Comment | Related Links | TrackBack
Related Content

Reverse.bash (GPL)

Reverse.bash is a Bash shell script that reverses the order of your text file. Simply pass the input and output file paths as argument and it will do the trick. Output file must not already exist or the software warns you and exits.

Reverse.bash is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site.

Usage

  Reverse.bash "infile" "outfile"

Attached File: Reverse.bash (595 B)

Chieh Cheng
Fri, 02 Feb 2007 19:28:23 -0800

Found a bug in Reverse.bash where it wouldn't work with lines that contain spaces. The new version attached below fixes that problem.

Attached File: 1 - Reverse.bash (810 B)

Chieh Cheng
Thu, 05 Feb 2009 23:48:27 +0000

I've made a huge improvement in this version of Reverse.bash by using the "tac" utility to perform the reverse operation. The improved version of Reverse.bash is attached below.

However, some systems (such as Mac OS X) does not have the "tac" utility. In those cases, the previous version of Reverse.bash, with its own reverse algorithm, is still better. In the future, I may modify Reverse.bash to support both methods.

Attached File: 2 - Reverse.bash (441 B)

Chieh Cheng
Fri, 20 Nov 2009 01:56:42 +0000

Noticed that the script is calling "sh" rather than BASH. So I made a minor change to call the right shell interpreter.

Attached File: 3 - Reverse.bash (452 B)

Chieh Cheng
Fri, 14 Aug 2015 12:25:22 +0400

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Answer of 7 + 3?
Click button only once, please!

TrackBack

TrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites.

Send Ping | TrackBack URL | Spam Control

No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.

Messages, files, and images copyright by respective owners.

Products | Services
Forums | Latest | RSS
Library | Search | Wiki
Help | Licenses

Login | Register

45 Users Online

Hacking Digital Cameras
Fun for Photographers



Amazon Associate

Copyright © 1996 - 2024. All Rights Reserved.