Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cat command in shell script creates error

0 views
Skip to first unread message

Eberhard Weber

unread,
Aug 30, 1996, 3:00:00 AM8/30/96
to

In a script named "msend", part of the "mreply" mailing list
program, there is this test:
if test -z "${mailfile}"; then
mailfile=${defmailfile}
cat > ${mailfile}

defmailfile is defined at the start as:
defmailfile=$HOME/.msend.message.$

What happens is that when msend is invoked from within mreply,
i.e. when I send a mail to a list which is processed by mreply,
the message header arrives but no the message.

The cat command alos does not work when it runs through the
list of names to send to in the line : number='cat "${listfile}" | wc -l'
which then tells me how many people the file is being sent to. It
is 0, even if a dozen names are there.

The same msend worked ok when I had an account at netcom, but
it does not work on another account and not on this one either.
In fact, at psnw I get the errors cat: not found as well as
test: not found for every one of the dozen tests contained in msend.
So I think it is a configuration problem.
Any ideas?

Thanks in advance
eberhard weber
--
__

---------------------------------------------------------------
Research Project On Global Systems glo...@psnw.com

Rich Kus

unread,
Aug 30, 1996, 3:00:00 AM8/30/96
to

In article <507emc$e...@mammoth.psnw.com>,

Eberhard Weber <glo...@mammoth.psnw.com> wrote:
>In a script named "msend", part of the "mreply" mailing list
>program, there is this test:
> if test -z "${mailfile}"; then
> mailfile=${defmailfile}
> cat > ${mailfile}
^^^^^^
cat is trying to get data from the keyboard. which is why
it dosen't work. you need to redirect the info to cat.

richk

Bill Marcum

unread,
Aug 31, 1996, 3:00:00 AM8/31/96
to

In article <507emc$e...@mammoth.psnw.com>,
Eberhard Weber <glo...@mammoth.psnw.com> wrote:
>The cat command alos does not work when it runs through the
>list of names to send to in the line : number='cat "${listfile}" | wc -l'
>which then tells me how many people the file is being sent to. It
>is 0, even if a dozen names are there.
>
You used ' where you should have used ` . Also you have a useless use of
cat.

number=`wc -l < ${listfile}`
--
Bill Marcum bma...@iglou.com
"Outside of a dog, a book is man's best friend. Inside a dog, it's too
dark to read." -- Marx (or was it Twain?)

0 new messages