Dropped the last line of the script. Also lined up the seds to show the
regex is the same in both.
#!/bin/sh
DESTDIR="./"
COMPFILE=".cshrc"
PSTR=`echo "${DESTDIR}${COMPFILE}" | sed 's%\([?:.%\\]\)%\\\1%g'`
echo ${PSTR}
PSTR=$(echo "${DESTDIR}${COMPFILE}" | sed 's%\([?:.%\\]\)%\\\1%g')
echo ${PSTR}
Also, the difference is in escapes; two more backslashes added to the
backtick version make it work:
PSTR=`echo "${DESTDIR}${COMPFILE}" | sed 's#\([?:.%\\]\)#\\\\\1#g'`
echo ${PSTR}
Still: aren't backticks and $() supposed to be equivalent?
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"