Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   input from a file for 'ed' (http://www.linux-archive.org/debian-user/400834-input-file-ed.html)

Ariful Hossain 07-18-2010 08:26 AM

input from a file for 'ed'
 
Can anyone explain what happens
$ed<temp

it ends up with a ken thompson's infamaous '?'

certainly first temp is created if not existed previously. and it may
also suppy an EOF(if read systemcall is called first). But i'm lost why
it behaves in this way?
--
Freeburn
life in a NIX shell
Registered linux user #517617


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1279441596.2432.12.camel@freeburn">http://lists.debian.org/1279441596.2432.12.camel@freeburn

Bob Proulx 07-18-2010 12:43 PM

input from a file for 'ed'
 
Ariful Hossain wrote:
> Can anyone explain what happens
> $ed<temp

Two possibilities. You are at a command prompt "$" and are invoking
the 'ed' text editor and redirecting input from a file "temp". Or you
are running a command "$ed" where $ed is an environment variable of
unknown content and redirecting the input from a file "temp". Without
any spaces or other information it isn't possible to tell the difference.

> it ends up with a ken thompson's infamaous '?'

What are the contents of the file "temp"? That is providing command
input to your 'ed' command. Since you haven't shown us what your ed
script is telling 'ed' to do it isn't possible to know.

> certainly first temp is created if not existed previously.

Huh? You say certainly as if we should know what the commands in
"temp" do. Please show us the temp file that we may know what
commands are being executed.

> and it may also suppy an EOF(if read systemcall is called first).
> But i'm lost why it behaves in this way?

You have not yet shown us enough information to help you.

Bob


All times are GMT. The time now is 11:07 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.