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
BZEXE(1)						      General Commands Manual							  BZEXE(1)

NAME
bzexe - compress executable files in place SYNOPSIS
bzexe [ name ... ] DESCRIPTION
The bzexe utility allows you to compress executables in place and have them automatically uncompress and execute when you run them (at a penalty in performance). For example if you execute ``bzexe /bin/cat'' it will create the following two files: -r-xr-xr-x 1 root bin 9644 Feb 11 11:16 /bin/cat -r-xr-xr-x 1 bin bin 24576 Nov 23 13:21 /bin/cat~ /bin/cat~ is the original file and /bin/cat is the self-uncompressing executable file. You can remove /bin/cat~ once you are sure that /bin/cat works properly. This utility is most useful on systems with very small disks. OPTIONS
-d Decompress the given executables instead of compressing them. SEE ALSO
bzip2(1), znew(1), zmore(1), zcmp(1), zforce(1) CAVEATS
The compressed executable is a shell script. This may create some security holes. In particular, the compressed executable relies on the PATH environment variable to find gzip and some other utilities (tail, chmod, ln, sleep). BUGS
bzexe attempts to retain the original file attributes on the compressed executable, but you may have to fix them manually in some cases, using chmod or chown. BZEXE(1)
All times are GMT -4. The time now is 09:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy