⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0157-0160.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:






<HTML>

<HEAD>

<TITLE>Sams Teach Yourself Linux in 24 Hours:Connecting to the Outside World:EarthWeb Inc.-</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311623 //-->

<!-- TITLE=Sams Teach Yourself Linux in 24 Hours//-->

<!-- AUTHOR=Bill Ball//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=09 //-->

<!-- PAGES=0139-0160 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->











<P><CENTER>

<a href="0153-0156.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="../ch10/0161-0163.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-157"><P>Page 157</P></A>





<P>

found under the /usr/bin directory with the pbm2g3 program&#151;for example,

</P>



<!-- CODE SNIP //-->

<PRE>

# cat myfile.txt | pbmtext | pbm2g3 &gt; myfile.g3

</PRE>

<!-- END CODE SNIP //-->



<P>This pipes the file myfile.txt through the

pbmtext command, which outputs a portable bitmap graphics format into the

pbm2g3 command, which then converts the piped stream

of characters into the fax graphic format. After you do this, you can send the file

(assuming that you're the root operator) with

</P>



<!-- CODE SNIP //-->

<PRE>

# /usr/sbin/sendfax -v -l ttyS1 -C cls2 -r 5551212 myfile.g3

Trying fax device `/dev/ttyS1'... OK.

Dialing 5551212... OK.

sending `myfile.g3'...

</PRE>

<!-- END CODE SNIP //-->



<P>This runs the sendfax program. The -v command-line option tells

sendfax to give some feedback during the faxing operation. I've specified the

ttyS1 serial port with the -l option, and sent the fax through a Class 2 fax modem with

-C cls2 command-line option. The phone number 555-1212 was specified with the

-r option, and the file, myfile.g3, was the file you created

with the preceding command-line pipe.

</P>



<P>If you would rather use a simpler approach, try the

faxspool program, which automatically converts your text file, and places it in the fax spool directory under the

/var/spool/fax directory&#151;for example,

</P>



<!-- CODE //-->

<PRE>

# faxspool 5551212 myfile.txt

spooling to /var/spool/fax/outgoing/F000010...

spooling myfile.txt...

myfile.txt is format: ascii

Aladdin Ghostscript 3.33 (4/10/1995)

Copyright (C) 1995 Aladdin Enterprises, Menlo Park, CA.  All rights reserved.

This software comes with NO WARRANTY: see the file COPYING for details.

Loading NimbusMonL-Bold font from /usr/share/ghostscript/fonts/n022004l.pfb...

&Acirc;1750128 436826 1320152 28679 0 done.

Printing myfile.txt

Page height = 67.

\nPutting Header lines on top of pages...

\nFax queued successfully. Will be sent at next `'faxrunq'' run.\n



</PRE>

<!-- END CODE //-->



<P>The faxspool program requires only a phone number and filename, and has the

advantage of handling multiple pages easily. You can see the number of faxes awaiting in the fax

queue with the faxq command&#151;for example,

</P>



<!-- CODE SNIP //-->

<PRE>

#  faxq

F000010/JOB: queued by bball. 1 page(s) to 5551212

</PRE>

<!-- END CODE SNIP //-->



<P>

The faxq command reports on the number of jobs you've created, the number of pages,

and the phone number of the remote fax machine. You can remove the waiting fax by

using the faxrm command, as in the following example:

</P>



<!-- CODE SNIP //-->

<PRE>

# faxrm F000010

</PRE>

<!-- END CODE SNIP //-->



<P>The waiting faxes may be sent by the root operator by running the

faxrunq command&#151;for example,

</P>





<A NAME="PAGENUM-158"><P>Page 158</P></A>





<!-- CODE //-->

<PRE>

# faxrunq

processing F000011/JOB...

/usr/sbin/sendfax -v 5551212 f1.g3

Trying fax device `/dev/ttyS1'... OK.

Dialing 5551212... OK.

sending `f1.g3'...

command exited with status 0

    send mail to bball...

</PRE>

<!-- END CODE //-->



<P>This shows that the faxrunq command uses the

sendfax program to look at the fax queue in the

/var/spool/fax directory, connects with the modem, dials out, and then sends the fax. One

nice feature of the sendfax software package is that a mail message is automatically mailed to

the fax sender to verify the faxing, as in the following example:

</P>



<!-- CODE //-->

<PRE>

...

Subject: OK: your fax to 5551212



Your fax has been sent successfully at: \c

Thu Dec  4 23:45:26 EST 1997

\n\nJob / Log file:

phone 5551212

user bball

input myfile.txt

pages  f1.g3

Status Thu Dec 4 23:45:26 EST 1997 successfully sent

\nSending succeeded after 0 unsuccessful tries.



</PRE>

<!-- END CODE //-->



<P>You can also set up your Linux system to automatically receive incoming faxes with

the mgetty program. Used much like the uugetty

program, mgetty also requires at least one change to its configuration file in the

/etc/mgetty+sendfax directory. The change you can make (as

the root operator) is to edit the phone identification entry in the file

mgetty.config&#151;for example,

</P>



<!-- CODE SNIP //-->

<PRE>

# set the local fax station id

#fax-id 49 89 xxxxxxxx

fax-id 1 202 555 1212

</PRE>

<!-- END CODE SNIP //-->



<P>

This sets the local fax machine phone number. After you do this, you should edit the

/etc/inittab file as described earlier, and use

mgetty to listen to the serial port&#151;for example,

</P>



<!-- CODE SNIP //-->

<PRE>

3:2345:respawn:/sbin/mgetty -s 38400 ttyS1

</PRE>

<P>



<CENTER>

<TABLE BGCOLOR="#FFFF99">

<TR><TD><B>

CAUTION

</B></TD></TR>

<TR><TD>

<BLOCKQUOTE>

As mentioned before, any edits of the /etc/inittab file are potentially

hazardous. Always have a spare boot disk and make a backup of the file first.

</BLOCKQUOTE></TD></TR>

</TABLE></CENTER>

</P>

<P>After you make this change, save the file and reboot the computer. Now, not only can

you receive faxes, but you also can dial in from an outside line and run Linux programs.

To see if any faxes have arrived, you'll have to explicitly look at the

/var/spool/fax/incoming 

</P>





<A NAME="PAGENUM-159"><P>Page 159</P></A>





<P>

directory&#151;for example,

</P>



<!-- CODE SNIP //-->

<PRE>

# ls -A /var/spool/fax/incoming

fn4878f9aS1-_IBM-APTIVA-M61-_.01  fn4878f9aS1-_IBM-APTIVA-M61-_.02

</PRE>

<!-- END CODE SNIP //-->



<P>This shows that a two-page fax awaits reading. You can read the faxes by first

converting them to the portable bitmap file format&#151;for example,

</P>

<!-- CODE SNIP //-->

<PRE>

# cat /var/spool/fax/incoming/*.01 | g32pbm &gt; faxpage1.pbm

</PRE>

<!-- END CODE SNIP //-->



<P>After you convert these fax files to the portable bitmap format, you can then use the

X11 xv client or the ImageMagick display X11 program to read or print your faxes.

</P>



<P>As you can see, you'll have several choices of faxing documents with Linux. The

sendfax program, like the efax family of programs, also accepts other types of files to fax, and

has many other options. Read the documentation for this program to find out the details.

</P>





<A NAME="PAGENUM-160"><P>Page 160</P></A>







<P><CENTER>

<a href="0153-0156.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="../ch10/0161-0163.html">Next</A>

</CENTER></P>











</td>
</tr>
</table>

<!-- begin footer information -->









</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -