On 12/04/2014 02:56 PM, Eric Blake wrote:
> So does sed, although no longer a short one-liner:
> 
> echo "$FILE" | sed -e 's/^\(.\{30\}\).*/\1/' \
>                    -e '$ {' \
>                    -e   's/$/ ============================/' \
>                    -e   's/^\(.\{30\}\).*/\1/' \
>                    -e   '$ s/$/ matches ==========/' \
>                    -e '}'

Or:

 echo "$FILE ============================" | \
  sed -e 's/^\(.\{30\}\).*/\1/' \
      -e '$ s/$/ matches ==========/'

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to