Linux equivalent package for "newform"

What is the rpm package details for the "newform" in solaris. ?

Solaris package description
"newform newform (1) - change the format of a text file"
/usr/bin/newform

If "newform" is not available as such, which of the rpm package that could be installed as a substitute. ?

Don't know of any direct substitute. Most any language can do the same thing, but it won't have the same options or syntax. Do you need the entire thing, or is there some specific task you need?

Nothing really to contribute just thought I'd drop a full reference in here for someone who has some ideas. Command description from one of my online books.

Hi.

Does Open{ Solariis, Indiana} provide source? If so, it might be compilable on Linux.

Best wishes ... cheers, drl

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:

#!/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:

% ./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

1 Like