www.mass.dk

Sharing what I know...

  • Increase font size
  • Default font size
  • Decrease font size
Home Netbackup Quick hints Remove null byte from bplist output

Remove null byte from bplist output

The output from bplist terminate each line with a null byte . This null byte is not direct visible on the console, but “vi” may show the null byte as a “^@”. Also a “od –c” indicate each line is terminated with \0\n.

Some regular expression will not work correctly because of this extra non-visible character. Particular those commands that must match end of line (e.g file extensions).

To resolve the issue use “sed” to strip off the null byte:

/usr/openv/netbackup/bin/bplist -B -C $CLIENT -R -t 13 / | sed 's/\x0//g'

you can also use a perl one liner (much faster)

/usr/openv/netbackup/bin/bplist -B -C $CLIENT -R -t 13 / | perl -pe 's/\x0+$//'

Regular expression will now work as intended.

Last Updated on Thursday, 22 September 2011 13:31