awk nawk oawk
in 1977 there was awk.\\ this page attempts to explain the history of awk.\\ the 1978 7th Edition awk(1) . . . \v (vertical tab), \xhhh (hexadecimal), \\ ENVIRON[] \\ comand line: -v x=1 -v y=2\\ CONVFMT\\ . . . for(varname in SYMTAB) \ if ((varname != "ENVIRON") && (varname != "ARGV") \ && . . .
2K - last updated 2012-03-18 23:21 UTC by g0pher
AwkFeatureComparison
This page lists which awk implementations support which features. Additions and corrections are very . . . |=ENVIRON array|yes|yes|yes|yes|yes|yes|unknown|yes|yes|yes| . . . -v foo=bar 'BEGIN {print foo}' # bar}}} | |=ENVIRON array|{{{a=FOO awk 'BEGIN {print ENVIRON["a"]}' . . .
4K - last updated 2015-04-27 13:23 UTC by pgas
AwkGuide
** Work in Progress ** {{{ import from Mark Hobley's wiki }}} <toc> ---- == Overview * [[Overview]] . . . [[empty string]] * [[END]] * [[enumeration]] * [[environment|ENVIRON]] * [[error handling]] * [[escape . . .
4K - last updated 2011-08-14 15:57 UTC by markhobley
AwkOnWindowsHowto
AwkOnWindowsHowto\\ rough cut - needs edit {{{ 3) awk command line switches/usage from a win32 cmd.exe . . . for(varname in SYMTAB) \ if ((varname != "ENVIRON") && (varname != "ARGV") \ && . . . [/min|/max] [/low|/high] [/wait] [/b] #: ENVIRON[] -- remember indices are case sensitive assoc . . .
3K - last updated 2010-10-24 07:44 UTC by g0pher
case conversion
The [[awk]] extraction and reporting language provides the toupper and tolower functions for converting . . . function are affected by the following locale environment variable settings. * LC_ALL * LC_CTYPE . . .
2K - last updated 2011-06-25 05:10 UTC by pgas
comp.lang.awk FAQ
This material of this faq originates from the comp.lang.awk FAQ that you can find there: * http://www.faqs.org/faqs/computer-lang/awk/faq/ . . . this answer]] ---- == How can I access shell or environment variables in an awk script? === Shells . . . Edit this answer]] === Environment variables in general <include "EnvVarGeneral"> . . . Edit this answer]] === ENVIRON[] and "env"|getline <include "ENVIRON"> . . . [[http://awk.freeshell.org/?action=edit;id=ENVIRON| Edit this answer]] === exporting environment . . .
8K - last updated 2009-03-04 12:42 UTC by pgas
comp.lang.awk FAQJapanese
This material of this faq originates from the comp.lang.awk FAQ that you can find there: * http://www.faqs.org/faqs/computer-lang/awk/faq/ . . . this answer]] ---- == How can I access shell or environment variables in an awk script? === Shells . . . Edit this answer]] === Environment variables in general <include "EnvVarGeneralJapanese"> . . . Edit this answer]] === ENVIRON[] and "env"|getline <include "ENVIRONJapanese"> . . . [[http://awk.freeshell.org/?action=edit;id=ENVIRONJapanese| Edit this answer]] === exporting environment . . .
4K - last updated 2008-11-24 09:01 UTC by pgas
ENVIRON
Modern versions of new awk (gawk, mawk, Bell Labs awk, any POSIX awk) all provide an array named ENVIRON. . . . The array is indexed by environment variable name; the value is that variable's . . . value. For instance, ENVIRON["HOME"] might be "/home/chris". To print out . . . and values, use a simple loop: {{{ awk for (i in ENVIRON) printf("ENVIRON['%s'] = '%s'\n", i, ENVIRON[i]) . . . }}} What if my awk doesn't have ENVIRON[]? Short answer, get a better awk. There are . . .
1K - last updated 2008-11-19 13:13 UTC by pgas
ENVIRONJapanese
Modern versions of new awk (gawk, mawk, Bell Labs awk, any POSIX awk) all provide an array named ENVIRON. . . . The array is indexed by environment variable name; the value is that variable's . . . value. For instance, ENVIRON["HOME"] might be "/home/chris". To print out . . . and values, use a simple loop: {{{ awk for (i in ENVIRON) printf("ENVIRON['%s'] = '%s'\n", i, ENVIRON[i]) . . . }}} What if my awk doesn't have ENVIRON[]? Short answer, get a better awk. There are . . .
1K - last updated 2008-11-24 08:05 UTC by pgas
environment
The ENVIRON [[associative container]] contains the values of the current environment. This enables an . . . environment variable to be accessed by using the environment . . . {{{ BEGIN { print "Your home directory is "ENVIRON["HOME"] } }}} == Manipulating the container . . . the revisions to a subprocess == Note that the ENVIRON [[associative container]] can be changed by . . . However, this does not affect the environment passed on to [[subprocess]]es that may . . .
1K - last updated 2011-06-07 01:05 UTC by markhobley
EnvVarGeneral
**Answer 1:** On Unix, use "alternate quoting", e.g. {{{ awk -F: '$1 ~ /'"$USER"'/ {print $5}' /etc/passwd . . . enviroment vars. Then perhaps {{{ awk -F: '$1 ~ ENVIRON["USER"] {print $5}' /etc/passwd }}} Always . . . scripts that it's easy to put things into the environment for a single command run: {{{ name=felix . . . age=56 awk '... ENVIRON["name"] .....' }}} this also works with ksh . . .
3K - last updated 2011-07-05 09:31 UTC by pgas
EnvVarGeneralJapanese
== 環境変数を使う **解答 1:** Unix では「もうひとつのクォート」を使います。例えば、以下のようなものです。 {{{ awk -F: '$1 ~ /'"$USER"'/ {print $5}' . . . 多分、以下のようにすれば分かるでしょう。 {{{ awk -F: '$1 ~ ENVIRON["USER"] {print $5}' /etc/passwd }}} ひとつのコマンドで環境変数を簡単に . . . {{{ name=felix age=56 awk '... ENVIRON["name"] .....' }}} これは ksh でも他のいくつかのシェルでも動作します。 . . .
2K - last updated 2008-11-23 14:37 UTC by hi saito
FIXES
[[FIXES]] revised: . . . \v (vertical tab), \xhhh (hexadecimal)\\ ENVIRON array contains environment: if shell variable . . . ENVIRON["V"] is "thing"\\ multiple -f arguments permitted.\\ . . . access to the environment (ENVIRON).\\ added -V to print version . . .
6K - last updated 2014-01-15 23:17 UTC by g0ph3r
PassingAShellVariable
The common solution is to use the -v option to define an awk variable giving it the value of the shell . . . '$0 ~ pattern{print}' }}} If your variable is an environment variable then you can access it using the . . . ENVIRON array: {{{ sh export FOO=bar awk 'BEGIN{print . . . ENVIRON["FOO"]}' }}} If this is not enough have a look . . .
1K - last updated 2009-01-30 08:36 UTC by pgas
PassingVariables
<toc> === Shells <include "Shells"> [[http://awk.freeshell.org/?action=edit;id=Shells| Edit . . . this answer]] === Environment variables in general <include "EnvVarGeneral"> . . . Edit this answer]] === ENVIRON[] and "env"|getline <include "ENVIRON"> . . . [[http://awk.freeshell.org/?action=edit;id=ENVIRON| Edit this answer]] === exporting environment . . .
1K - last updated 2008-11-19 07:47 UTC by pgas
PassingVariablesToTheParentProcess
How can I put values into the environment of the program that called my awk program? Short answer, you . . . any memory location, including the parent's environment space. But the details are [obviously] . . .
1K - last updated 2008-11-19 07:45 UTC by pgas
PassingVariablesToTheParentProcessJapanese
How can I put values into the environment of the program that called my awk program? Short answer, you . . . any memory location, including the parent's environment space. But the details are [obviously] . . .
1K - last updated 2008-11-24 08:05 UTC by pgas
ReadDirectory
Getting a list of files in a directory is a tricky process. One might be tempted to try use ls and getline, . . . before adding it to the array. You can also add ENVIRON["PWD"] or dir when storing the files to get . . .
2K - last updated 2013-10-03 22:35 UTC by emg
ShellQuoting
Quoting can be such a headache for the novice, in shell programming, and especially in awk. Art Povelones . . . the shell will copy verbatim, not interpreting environment variable substitutions etc.) {{{ cat <<'@@' . . .
2K - last updated 2008-11-19 07:41 UTC by pgas
special variable
Some [[variable]] names have a special meaning to the awk interpreter. == List of special variables == . . . the conversion format of numerical strings | [[ENVIRON]] | An informative array that contains the . . . environment strings | [[FILENAME]] | An informative . . .
2K - last updated 2011-06-25 05:46 UTC by pgas
tracert.awk
{{{ awk #:: C:\_\_u\tracert.awk #: 2014-07-06 19:47:02 #:: rod.t_2014 #:: extract basename for tracert . . . } function _env(s, i) { s = tolower(s); for(i in ENVIRON) if(tolower(i) == s) \ return(ENVIRON[i]); . . .
4K - last updated 2014-07-07 06:15 UTC by 212.205.56.222
21 pages found.