Move under www to ease rsync
This commit is contained in:
15
www/eps/hpr2824/hpr2824_awk15_ex7.awk
Executable file
15
www/eps/hpr2824/hpr2824_awk15_ex7.awk
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/awk -f
|
||||
|
||||
# Downloadable example 7 for GNU Awk Part 15
|
||||
|
||||
BEGIN {
|
||||
db = "awktest.db"
|
||||
cmd = "sqlite3 " db
|
||||
querytpl = "select id,title from episodes where id = %d;\n"
|
||||
}
|
||||
|
||||
$0 ~ /^[0-9]+$/ {
|
||||
printf querytpl,$0 |& cmd
|
||||
cmd |& getline result
|
||||
print result
|
||||
}
|
||||
Reference in New Issue
Block a user