Improved a little.  Is it appropriate for inclusion in sbase?
#!/bin/sh
dump="xxd -g1"
dedump="xxd -r"

[ -z "$1" -o -z "$2" ] && { echo "$0 infile outfile"; exit 1; }
[ -z "$EDITOR" ] && { echo "\$EDITOR must be defined"; exit 1; }

tmpfile=$(mktemp) || exit 1
infile="$1"
outfile="$2"

$dump "$infile" > "$tmpfile"
$EDITOR "$tmpfile"
$dedump $tmpfile > "$outfile"
rm "$tmpfile"

Reply via email to