2010-03-28 13:41:50 by Aleksey Cheusov | Files touched by this commit (3) |
Log message:
Uopdate to 0.21.0
fixed: compilation failure on recent Linux-es (warn_unused_result
attribute of system(3) function in recent glibc).
fixed: compilation failures on FreeBSD ("assignment discards
qualifiers from pointer target type" warning which is critical with
-Werror).
fixed: compilation failure with Intel C Compiler
Now one can pass arguments to awk program specified with
-e option after --, that is like the following
runawk -e '<awk program>' -- <extra options for your program>
New simple modules:
- trim.awk: this modules provides a set of simple functions for
trimming spaces from the string.
- backslash_in.awk treats backslash symbol at the end of input line
as "this line will continue on the next line".
$ cat ~/tmp/9.txt
Some text here \
and here too. \
This is still the first line.
This is the second.
And this is third one that\
continues on the next line \
and the next line too.
Ok, we finally have four lines of text.
$ runawk -f backslash_in.awk -e '{print}' ~/tmp/9.txt
Some text here and here too. This is still the first line.
This is the second.
And this is third one that continues on the next line and the next
line too.
Ok, we finally have four lines of text.
$
- trim_in.awk trims spaces from input lines.
- CR_in.awk removes CR symbols from input lines.
|
2010-03-04 18:22:25 by Aleksey Cheusov | Files touched by this commit (3) |
Log message:
Update to version 0.20.0
MAJOR CHANGES:
========================================
New module: fieldwidths.awk:
By default AWK interpreter splits input lines into tokens
according to regular expression that defines "spaces" between them
using special variable FS. Sometimes it is useful to define a
fixed-size fields for tokens. This is what this module is for. The
functionality of fieldwidths.awk is very close to GNU awk's
FIELDWIDTHS variable but is available for all flavours of AWK ;-)
New module: tmpfile.awk:
This module provides a function `tmpfile' for generating temporary
filenames. All these filenames are under temporary directory
created (if necessary) by runawk(1) which is removed automatically
during normal exit or when runawk(1) reveives SIGINT, SIGQUIT,
SIGTERM, SIGHUP or SIGPIPE. Thus, this module provides a safe way
to work with temporary files.
new runawk directive: #interp-var that specifies an environment
variable name that keeps a preferred AWK interpreter. See a manual
page for details.
new runawk directive: #safe-use that #use module if it
exists. Example is below. For more details see a manual page.
foobar application:
#!/usr/bin/env runawk
#safe-use "~/.foobarrc" "/etc/foobar.conf"
BEGIN {
print foo, bar, baz
}
config file ~/.foobarrc for foobar application:
BEGIN {
foo = "foo10"
bar = "bar20"
baz = 123
}
fix in power_getopt.awk: arguments equal to "" (empty string) are
now processed correctly.
power_getopt.awk: after options processing ARGV [1], ARGV [2], ...,
ARGV [ARGC-1] are set to non-option arguments.
new in heapsort.awk: functions sift_down and sift_up.
fix in tokenre.awk: There is no need to initialize TRE variable, it
is already initialized to "" at startup. This fixes a problem with
'runawk -v TRE=lalala ...'
Minor fixes and rewords in the runawk.1 and README.
|
2010-01-03 15:36:18 by Aleksey Cheusov | Files touched by this commit (3) |
Log message:
Update to version 0.19.0
fix in runawk.c: \n was missed in "running '%s' failed: %s" error
message. The problem was seen on ancient (12 years old) HP-UX
fix in teets/test.mk: "diff -u" is not portable (SunOS, HP-UX),
DIFF_PROG variable is introduced to fix the problem
fix in modules/power_getopt.awk: after printing help message we
should exit immediately not running END section, s/exit/exitnow/
new function heapsort_values in heapsort.awk module
new function quicksort_values in quicksort.awk module
new function sort_values in sort.awk module
|
2009-11-11 19:19:14 by Aleksey Cheusov | Files touched by this commit (3) | |
Log message:
updated to 0.18.0
Makefile:
!!! "install-dirs" target has been renamed to \
"installdirs" !!!
- At compile time MODULESDIR can contain a *list* of
colon-separated directories,
e.g. /usr/local/share/runawk:/usr/local/share/awk
- power_getopt.awk, alt_getopt.awk and init_getopt.awk:
- Support for multiply applied options, e.g. -vvv for increasing
verbosity level. If option without arguments is multiply
applied, getarg() function returns a number of times it was
applied, not just 0 or 1.
New modules:
- init_getopt.awk using alt_getopt.awk and used by power_getopt.awk.
Its goal is to initialize `long_opts' and `long_opts' variables
but not run `getopt' function.
- heapsort.awk - heapsort :-)
- quicksort.awk - quicksort :-)
- sort.awk - either heapsort or quicksort,
the default is heapsort.
Unfortunately GAWK's asort() and asorti() functions
do *not* satisfy my needs. Another (and more important) reason
is a portability.
Improvements, clean-ups and fixes in regression tests.
runawk-0-18-0 was successfully tested on the following platforms:
NetBSD-5.0/x86, NetBSD-2.0/alpha, OpenBSD-4.5/x86,
FreeBSD-7.1/x86, FreeBSD-7.1/spark, Linux/x86 and
Darwin/ppc.
|
2009-09-13 10:02:25 by Aleksey Cheusov | Files touched by this commit (1) |
Log message:
fix: two new files
|
2009-09-12 15:02:25 by Aleksey Cheusov | Files touched by this commit (3) | |
Log message:
update to 0.17.0
MAJOR CHANGES
-------------
runawk:
- ADDED: new option for runawk for #use'ing modules: -f.
runawk can also be used for oneliners! ;-)
runawk -f abs.awk -e 'BEGIN {print abs(-123); exit}'
- In a multilined code passed to runawk using option -e, spaces
are allowed before #directives.
- After inventing alt_getopt.awk module there is no reason for
heuristics that detects whether to add `-' to AWK arguments or
not. So I've removed this heuristics. Use alt_getopt.awk module
or other "smart" module for handling options correctly!
alt_getopt.awk and power_getopt.awk:
- FIX: for "abc:" short options specifier BSD and GNU getopt(3)
accept "-acb" and understand it as "-a -cb", they also \
accept
"-ac b" and also translate it to "-a -cb". Now \
alt_getopt.awk
and power_getopt.awk work the same way.
power_getopt.awk:
- -h option doesn't print usage information, --help (and its short
synonym) does.
New modules:
- shquote.awk, implementing shquote() function.
shquote(str):
`shquote' transforms the string `str' by adding shell
escape and quoting characters to include it to the
system() and popen() functions as an argument, so that
the arguments will have the correct values after being
evaluated by the shell.
Inspired by NetBSD's shquote(3) from libc.
- runcmd.awk, implementing functions runcmd1() and xruncmd1()
runcmd1(CMD, OPTS, FILE):
wrapper for function system() that runs a command CMD
with options OPTS and one filename FILE. Unlike
system(CMD " " OPTS " " FILE) the function runcmd1()
handles correctly FILE and CMD containing spaces, single
quote, double quote, tilde etc.
xruncmd1(FILE):
safe wrapper for 'runcmd(1)'.
awk exits with error if running command failed.
- isnum.awk, implementing trivial isnum() function,
see the source code.
- alt_join.awk, implementing the following functions:
join_keys(HASH, SEP):
returns string consisting of all keys from HASH separated
by SEP.
join_values(HASH, SEP):
returns string consisting of all values from HASH separated
by SEP.
join_by_numkeys (ARRAY, SEP [, START [, END]]):
returns string consisting of all values from ARRAY
separated by SEP. Indices from START (default: 1) to END
(default: +inf) are analysed. Collecting values is stopped
on index absent in ARRAY.
|
2009-08-10 22:30:25 by Aleksey Cheusov | Files touched by this commit (1) |
Log message:
LICENSE=mit
|
2009-08-10 21:28:53 by Aleksey Cheusov | Files touched by this commit (1) |
Log message:
remove @dirrm directive
|
2009-08-10 21:28:18 by Aleksey Cheusov | Files touched by this commit (1) |
Log message:
LINECSE=mit
|
2009-04-05 17:19:03 by Aleksey Cheusov | Files touched by this commit (1) |
Log message:
minor clean-ups
|