/
niceSOFT
/
gawk
Обзор
Документация
Войти
/
niceSOFT
/
gawk
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
awklib/eg/prog/awksed.awk
35 строк
664 B
Arnold D. Robbins
Add blurb pointing to manual to all example programs.
12 май 2025, 22:26
12 май 2025, 22:26
e11c16e
Код
Авторство
О чём код?
# awksed.awk --- do s/foo/bar/g using just print # Thanks to Michael Brennan for the idea # # This file and how to use it are described in the manual. # Therefore, we respectfully advise you to Read The Fine Manual # for more information. # # Arnold Robbins, arnold@skeeve.com, 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 }