Sponsored Content
Operating Systems Linux Linux equivalent package for "newform" Post 302793769 by drl on Saturday 13th of April 2013 02:48:11 PM
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:
 

2 More Discussions You Might Find Interesting

1. 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

2. 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
RPMSPEC(8)						      System Manager's Manual							RPMSPEC(8)

NAME
rpmspec - RPM Spec Tool SYNOPSIS
QUERYING SPEC FILES: rpmspec {-q|--query} [select-options] [query-options] SPEC_FILE ... select-options [--rpms] [--srpms] query-options [--qf,--queryformat QUERYFMT] [--target TARGET_PLATFORM] QUERY OPTIONS The general form of an rpm spec query command is rpm {-q|--query} [select-options] [query-options] You may specify the format that the information should be printed in. To do this, you use the --qf|--queryformat QUERYFMT option, followed by the QUERYFMT format string. See rpm(8) for details. SELECT OPTIONS --rpms Operate on the binary package header(s). --srpm Operate on the source package header(s). SEE ALSO
popt(3), rpm(8), rpmdb(8), rpmkeys(8), rpmsign(8), rpm2cpio(8), rpmbuild(8), rpmspec --help - as rpm supports customizing the options via popt aliases it's impossible to guarantee that what's described in the manual matches what's available. http://www.rpm.org/ <URL:http://www.rpm.org/> AUTHORS
Marc Ewing <marc@redhat.com> Jeff Johnson <jbj@redhat.com> Erik Troan <ewt@redhat.com> Panu Matilainen <pmatilai@redhat.com> Red Hat, Inc 29 October 2010 RPMSPEC(8)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy