On 05/18/2013 10:09 AM, Quartz wrote:
However, if the OP wanted to actually truncate $FOO to 51 characters: NEWFOO=$( echo "$FOO" | awk -v max=51 '{print substr($0,0,max)}' )You don't need all that for a simple truncation/substring, you can do it with a direct assignment: newfoo=${foo:0:51}
That works for bash, not sh. -- ---------------------------------------------------------------------------- Tim Daneliuk [email protected] PGP Key: http://www.tundraware.com/PGP/ _______________________________________________ [email protected] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[email protected]"
