I have made a bash function that calls an awk script.
edvart-fire ()
{
local epath="${HOME}/Opstk/bin/gungadin-1.0/opcon/edvart"
awk ${epath}/firefly.awk "${@:--}"
}
How can I run this bash function?
I have made a bash function that calls an awk script.
edvart-fire ()
{
local epath="${HOME}/Opstk/bin/gungadin-1.0/opcon/edvart"
awk ${epath}/firefly.awk "${@:--}"
}
How can I run this bash function?
Setting aside the function for a minute ... what are the various ways you would normally call awk
with firefly.awk
?
With these in hand you can then figure out how to call the function ...
# this:
awk -f "${epath}"/firefly.awk
# becomes this:
edvart-fire
# this:
awk -f "${epath}"/firefly.awk file1 file2 file3
# becomes this:
edvart-fire file1 file2 file3
# this:
awk -f "${epath}"/firefly.awk -v v1=33 -v v2="abc def" file1 file2 file3
# becomes this:
edvart-fire -v v1=33 -v v2="abc def" file1 file2 file3
# this:
printf "abc\ndef\n" | awk -f "${epath}"/firefly.awk
# becomes this:
printf "abc\ndef\n" | edvart-fire
This assumes the function is first updated per comments, eg:
edvart-fire ()
{
local epath="${HOME}/Opstk/bin/gungadin-1.0/opcon/edvart"
awk -f "${epath}"/firefly.awk "${@:--}"
}