Linux equivalent package for "newform"


 
Thread Tools Search this Thread
Operating Systems Linux Linux equivalent package for "newform"
Prev   Next
# 5  
Old 04-13-2013
Hi.

A Google search for openindiana source "newform" produced about 60K hits. From one of those I found the source for the code and man page. It compiled first time with gcc. Here's a sample run:
Code:
#!/usr/bin/env bash

# @(#) s1	Demonstrate basic reformatting of text file: newform.

# See: Google search for [openindiana source "newform"]

# Utility functions: print-as-echo, print-line-with-visual-space, debug.
# export PATH="/usr/local/bin:/usr/bin:/bin"
pe() { for _i;do printf "%s" "$_i";done; printf "\n"; }
pl() { pe;pe "-----" ;pe "$*"; }
db() { ( printf " db, ";for _i;do printf "%s" "$_i";done;printf "\n" ) >&2 ; }
db() { : ; }
C=$HOME/bin/context && [ -f $C ] && $C newform ruler

FILE=${1-data1}

pl " Display usage:"
newform -Q

pl " Input data file $FILE, raw:"
cat $FILE

pl " Input data file $FILE, display invisibles:"
cat -A $FILE

pl " Results, raw (with column markers):"
ruler 78
newform -s -i -l -a -e $FILE

pl " Results, display invisibles:"
ruler 78
newform -s -i -l -a -e $FILE |
cat -A

exit 0

producing:
Code:
% ./s1

Environment: LC_ALL = C, LANG = C
(Versions displayed with local utility "version")
OS, ker|rel, machine: Linux, 2.6.26-2-amd64, x86_64
Distribution        : Debian GNU/Linux 5.0.8 (lenny) 
bash GNU bash 3.2.39
newform (local) $Revision: 1.3$, (OpenSolaris 5.10, 1997)
ruler - ( local: RepRev 1.8, ~/bin/ruler, 2013-04-11 )

-----
 Display usage:
usage: newform  [-s] [-itabspec] [-otabspec] [-pn] [-en] [-an] [-f] [-cchar]
		[-ln] [-bn] [file ...]

-----
 Input data file data1, raw:
1	Hello, world.
2		Good	bye,	world.

-----
 Input data file data1, display invisibles:
1^IHello, world.$
2^I^IGood^Ibye,^Iworld.$

-----
 Results, raw (with column markers):
         1         2         3         4         5         6         7
123456789012345678901234567890123456789012345678901234567890123456789012345678
Hello, world.                                                           1
        Good    bye,    world.                                          2

-----
 Results, display invisibles:
         1         2         3         4         5         6         7
123456789012345678901234567890123456789012345678901234567890123456789012345678
Hello, world.                                                           1$
        Good    bye,    world.                                          2$

Best wishes ... cheers, drl
This User Gave Thanks to drl For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. AIX

mkinstallp package creation failing "no such file: ./usr/lpp/<package name>/inst_root"

Hello, I'm trying to build a (bff) package from an already installed program (clam antivirus) using mkinstallp. However, mkinstallp fails with "no such file: ./usr/lpp/<package name>/inst_root" I'm not sure why all files get created ok except for these particular ones. Any help would be... (2 Replies)
Discussion started by: omonte
2 Replies

2. UNIX for Advanced & Expert Users

Commands on Digital Unix equivalent to for "top" and "sar" on other Unix flavour

Hi, We have a DEC Alpha 4100 Server with OSF1 Digital Unix 4.0. Can any one tell me, if there are any commands on this Unix which are equivalent to "top" and "sar" on HP-UX or Sun Solaris ? I am particularly interested in knowing the CPU Load, what process is running on which CPU, etc. ... (1 Reply)
Discussion started by: sameerdes
1 Replies
Login or Register to Ask a Question