sh/sed combinations. This aims to be more portable.
Changelog since HylaFAX 4.2.4
* Include crypt.h where necessary (BUG 722) (9 Jan 2005)
+* Fix eval sed in faxrcvd script (BUG 719) (9 Jan 2006)
* Fix shell comments in nofity AWK script (BUG 719) (9 Jan 2006)
Changelog for HylaFAX 4.2.4
MSG="$1"; shift;
COUNT=1
while [ $# -ge 1 ]; do
- # In shell scripts, there are no special characters in hard-quoted
- # strings (quoted with (')). Single-quotes can't even be escaped
- # inside such strings and must be put outside of them. We thus replace
- # (') with ('\'') which terminates the current string, adds a single
- # quote and starts a new string.
- eval "CALLID$COUNT='`echo $1 | $SED -e "s/'/'\\\\\''/g"`'"
+ # The eval has $1 set yet, and this forces a variable-to-variable
+ # assignment, allowing us to not need to do escaping
+ eval CALLID$COUNT='$1'
shift
COUNT=`expr $COUNT + 1`
done