Skip to content

Instantly share code, notes, and snippets.

@linneman
Created February 23, 2016 20:21
Show Gist options
  • Save linneman/de40cb0d75fa2759f912 to your computer and use it in GitHub Desktop.
Save linneman/de40cb0d75fa2759f912 to your computer and use it in GitHub Desktop.
awk script to further convert nv-item update script output from ORCT to whatever output format
#!/usr/bin/env awk -f
# awk script to further convert nv-item update script output from ORCT
# to whatever output format. In the given example each invocation of
# the nvimg application is quoted in order to further process the
# result code.
#
# invocation: ./convert.sh <update-script-file>
BEGIN { RS = ""; FS = "\n" }
{
if ($0 ~ /nvimgr/)
{
print $1
printf "$("
for(i = 2; i <= NF; ++i ) {
str = $i
{ gsub(/\\/, "", str); printf str }
}
print ")\n"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment