Thank you both for reply! Unfortunately, I am not quite sure how to use the exec command. It seems like that the tother method (<>) is quite useful, but I have no idea how can I write to the log continuously.
You use it like I show it, basically. It's among other things the shell's "open a file" setting. Here I use it to open file descriptor 5, in read-write <> mode.
File descriptors 0, 1, and 2 are standard in, standard out, and standard error, respectively. Numbers 3 and up are generally not opened yet in a shell and can be used as you please.
Code:
exec 6<inputfile # Open file for read
read LINE <&6 # Read a line from it
exec 6<&- # Close file
exec 7>logfile # open a file for write
echo asdf > &7 # Write to file
exec 7>&- # Close file
Does my code not work, or not fulfill your purpose? What is your question?
Hi everyone
I am having some real difficulties getting a dial in modem to work on one of my HP boxes. It's a mux modem on port 7 which I have set up at 9600 baud.
I can dial in, the handshakes are completed, but then it returns incoherent characters on the emulation screen. I think my dial in... (1 Reply)
I've spent enough time trying to put on work Lucent Winmodem in my armada M300 (compaq laptop) I use Mandrake 8.0 but as soon as i get connected
and prompmts appears modem shutsdown.
Does any one had a similar situation, solved it?
cheers (2 Replies)
Hi!
I have a little prob with dialing up to the internet... When I try connect, it says "Sorry, modem is busy"...
Specs:
Laptop
56K modem
Slackware 8.0
Kernel 2.4.5
Cheers;) (4 Replies)
Specs:
Dlink DFE-560EL external modem.
RedHat 7.1
How do you turn off the modem volume? I am getting annoyed of it beeping everytime I use it but there is no switch on the hardware to tune down the volume.
I have tried using minicom and use the following commands:
ATL0
ATM0
Next, I... (2 Replies)
Pleaseee... Helpppp.... !!!
I am using SCO Open Server 5.05. Recently, i have upgraded the system which means transfer all apps and data to the new system. Everything work well except one thing. On my old system i have an external modem which to dial out. Now that i use the same modem on... (4 Replies)
I have got Suse 8.0 by using a modem (US Robotics 56K Faxmodem Ext).
During connection i got the error 16. I tried it under RedHat and Mandrake too.....same problem. What can i do ?
Thanx...a lot...
Logfile:
SuSE Meta pppd (smpppd), Version 0.73 on zuhause.
wwwoffle not is running ... (1 Reply)
Ok. I tried following the directions from some of the other threads, but I've hit a road block.
I have red hat 7.3 and I installed the hcf package:
hcfpcimodem-0.99lnxtbeta03042700k2.4.18_3-1rh.i386.rpm
It installed ok, no errors, but I still can't get linux to find my modem. I've tried... (2 Replies)
Hi all,
Is there any difference between a null modem cable or a modem cable ?
i assume that a null modem cable is a normal cable that i used from cpu serial ports to a modem for dialup.
please correct if i am wrong,
thks (2 Replies)
Hi, my first Sco question so go easy!
We have a customer who is on Sco v5.0.2. We are attempting to talk a consultant on site through how to configure the MODEM in scoadmin. Unfortunately the MODEM install instructions that we work from only work for v5.0.4 and assume that scoadmin has an option... (1 Reply)
hi folks,
i am looking for a analog modem to use it with a solaris9 sparc mashine. as far as i know, solaris communicates with the modem using AT-commands. so do i need a special modem for solaris or just a modem? i am open for everything. PCI-modem, seriell modem, usb modem. what are you using? i... (1 Reply)
Discussion started by: pressy
1 Replies
LEARN ABOUT POSIX
exec
EXEC(1P) POSIX Programmer's Manual EXEC(1P)PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond-
ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
NAME
exec -- execute commands and open, close, or copy file descriptors
SYNOPSIS
exec [command [argument...]]
DESCRIPTION
The exec utility shall open, close, and/or copy file descriptors as specified by any redirections as part of the command.
If exec is specified without command or arguments, and any file descriptors with numbers greater than 2 are opened with associated redi-
rection statements, it is unspecified whether those file descriptors remain open when the shell invokes another utility. Scripts concerned
that child shells could misuse open file descriptors can always close them explicitly, as shown in one of the following examples.
If exec is specified with command, it shall replace the shell with command without creating a new process. If arguments are specified, they
shall be arguments to command. Redirection affects the current shell execution environment.
OPTIONS
None.
OPERANDS
See the DESCRIPTION.
STDIN
Not used.
INPUT FILES
None.
ENVIRONMENT VARIABLES
None.
ASYNCHRONOUS EVENTS
Default.
STDOUT
Not used.
STDERR
The standard error shall be used only for diagnostic messages.
OUTPUT FILES
None.
EXTENDED DESCRIPTION
None.
EXIT STATUS
If command is specified, exec shall not return to the shell; rather, the exit status of the process shall be the exit status of the program
implementing command, which overlaid the shell. If command is not found, the exit status shall be 127. If command is found, but it is not
an executable utility, the exit status shall be 126. If a redirection error occurs (see Section 2.8.1, Consequences of Shell Errors), the
shell shall exit with a value in the range 1-125. Otherwise, exec shall return a zero exit status.
CONSEQUENCES OF ERRORS
Default.
The following sections are informative.
APPLICATION USAGE
None.
EXAMPLES
Open readfile as file descriptor 3 for reading:
exec 3< readfile
Open writefile as file descriptor 4 for writing:
exec 4> writefile
Make file descriptor 5 a copy of file descriptor 0:
exec 5<&0
Close file descriptor 3:
exec 3<&-
Cat the file maggie by replacing the current shell with the cat utility:
exec cat maggie
RATIONALE
Most historical implementations were not conformant in that:
foo=bar exec cmd
did not pass foo to cmd.
FUTURE DIRECTIONS
None.
SEE ALSO
Section 2.14, Special Built-In Utilities
COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2013 Edition, Standard for Information Technol-
ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, Copyright (C) 2013 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. (This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Stan-
dard is the referee document. The original Standard can be obtained online at http://www.unix.org/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source
files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
IEEE /The Open Group 2013 EXEC(1P)