Hi Jeremy, The sed scrips do a bit of string replacement.
It seems the commands you listed below put the backslash on the next line, rather than appended to the current line. If you want to loop over multiple input files, you might try $@, see: http://www.mail-archive.com/[email protected]/msg00400.html Any other ideas? The sed regex looks like a mess, but it's working correctly. It could be slightly more efficient with just one call to sed, if [ -f "$1" ]; then basename $1 | sed -e "s/\(.*\)/\1 \\\/" md5 $1 | sed -e "s/^MD5.*=/md5/" -e "s/\(.*\)/\1 \\\/" openssl sha1 $1 | sed -e "s/^SHA1.*=/sha1/" -e "s/\(.*\)/\1 \\\/" openssl rmd160 $1 | sed -e "s/^R.*=/rmd160/" fi The if statement checks if the input is a regular file. Anyhow, check the tips and tricks again, because port -v checksum offers a nice alternative! https://trac.macports.org/wiki/CommittersTipsAndTricks Take care, Darren On Tue, Jun 23, 2009 at 11:00 AM, Jeremy Lavergne < [email protected]> wrote: > If all those sed scripts calls for outputting the backslash, why not just > use echo? > > for i in $1 > do > md5 "$i"; echo "\" > openssl sha1 "$i"; echo "\" > openssl rmd160 "$i"; echo "\" > done > >
_______________________________________________ macports-dev mailing list [email protected] http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev
