convert sprintf() statement to printf() statement in awk

35 Views Asked by At

i have a script in awk that executes a command via sprintf(). this gives a return value. i do not want any return values, i just want to execute the command. i thought printf() would be a simple drop-in replacement, since the docs say the only difference between the two is the return value. first, here's the lines from the script:

TICKCOUNT = 0
commandSQL = "sqlite3 -noheader -separator \" \" " db " \" %s \""
querySQL = "update pulseCount set pulses=" TICKCOUNT ";"
system(printf(commandSQL, querySQL))

when i run the script above, i get -- Loading resources from /path/to/.sqliterc as a return value. i want to reduce the I/O as much as possible on this embedded device, so i don't want the extra cycles to give me feedback. when i replace the sprintf() with printf(), i get this error: awk: myScript.awk:4: Unexpected token.

can someone explain why the disjunct given they're supposed to basically be the same command with the same syntax? and what would i replace sprintf() with so as to reduce the I/O?

0

There are 0 best solutions below