Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / share / doc / gawk / examples / prog / | server ip : 172.67.156.115 your ip : 172.70.179.71 H O M E |
Filename | /usr/share/doc/gawk/examples/prog/awksed.awk |
Size | 515 |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 09:55 |
Last modified | 29-Mar-2012 04:03 |
Last accessed | 08-Jul-2025 06:16 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
# awksed.awk --- do s/foo/bar/g using just print
# Thanks to Michael Brennan for the idea
#
# Arnold Robbins, [email protected], Public Domain
# August 1995
function usage()
{
print "usage: awksed pat repl [files...]" > "/dev/stderr"
exit 1
}
BEGIN {
# validate arguments
if (ARGC < 3)
usage()
RS = ARGV[1]
ORS = ARGV[2]
# don't use arguments as files
ARGV[1] = ARGV[2] = ""
}
# look ma, no hands!
{
if (RT == "")
printf "%s", $0
else
print
}
# Thanks to Michael Brennan for the idea
#
# Arnold Robbins, [email protected], Public Domain
# August 1995
function usage()
{
print "usage: awksed pat repl [files...]" > "/dev/stderr"
exit 1
}
BEGIN {
# validate arguments
if (ARGC < 3)
usage()
RS = ARGV[1]
ORS = ARGV[2]
# don't use arguments as files
ARGV[1] = ARGV[2] = ""
}
# look ma, no hands!
{
if (RT == "")
printf "%s", $0
else
}