ksh 中从第二个字开始截断的参数值
Parameter value truncated from second word onwards in ksh
我正在调用 commonfuncs
中的函数来发送电子邮件,如下所示:
#!/usr/bin/ksh
. commonfuncs
emailsend 'test mail' 'body of the mail' 'abc.efg@domain.com'
函数如下:
function emailsend
{
esubject=
etext=
etolist=
efromid="from.id@domain.com"
echo $etext >email.txt
cat email.txt | mailx -r $efromid -s $esubject $etolist
}
邮件发送正常。但主题仅作为 test
而不是 test mail
发送。也试过用双引号但没用。
尝试将malix
命令的参数用双引号括起来:
cat email.txt | mailx -r "$efromid" -s "$esubject" "$etolist"
因为space
字符是命令行参数的定界符。
我正在调用 commonfuncs
中的函数来发送电子邮件,如下所示:
#!/usr/bin/ksh
. commonfuncs
emailsend 'test mail' 'body of the mail' 'abc.efg@domain.com'
函数如下:
function emailsend
{
esubject=
etext=
etolist=
efromid="from.id@domain.com"
echo $etext >email.txt
cat email.txt | mailx -r $efromid -s $esubject $etolist
}
邮件发送正常。但主题仅作为 test
而不是 test mail
发送。也试过用双引号但没用。
尝试将malix
命令的参数用双引号括起来:
cat email.txt | mailx -r "$efromid" -s "$esubject" "$etolist"
因为space
字符是命令行参数的定界符。