Unix Shell - 'more' fails, but 'vi' works??

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > February 2007 > 'more' fails, but 'vi' works??





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author 'more' fails, but 'vi' works??
qazmlp1209@rediffmail.com

2007-02-17, 1:22 am

'more <fileName>' does not show anything in the file. It exits
immediately without showing the contents.
But, I can do 'vi'. The 'ls -l <fileName>' also shows 80 bytes as the
size and all the permission bits are set.

'file <fileName>' shows
<fileName>: commands text

What is the reason why the 'more <fileName>' fails?

Kenny McCormack

2007-02-17, 1:17 pm

In article <1171696623.532022.125720@t69g2000cwt.googlegroups.com>,
<qazmlp1209@rediffmail.com> wrote:
>'more <fileName>' does not show anything in the file. It exits
>immediately without showing the contents.
>But, I can do 'vi'. The 'ls -l <fileName>' also shows 80 bytes as the
>size and all the permission bits are set.
>
>'file <fileName>' shows
><fileName>: commands text
>
>What is the reason why the 'more <fileName>' fails?


Maybe you have "more" aliased to ":".

Andrew Smallshaw

2007-02-18, 7:17 pm

On 2007-02-17, qazmlp1209@rediffmail.com <qazmlp1209@rediffmail.com> wrote:
> 'more <fileName>' does not show anything in the file. It exits
> immediately without showing the contents.
> But, I can do 'vi'. The 'ls -l <fileName>' also shows 80 bytes as the
> size and all the permission bits are set.


Many mores will exit immediately if the file is less than a screenful,
which will probably be the case with an 80 byte file. As for why
nothing appears, I can't say for sure. Are there any strange
characters in the file (eg carriage returns or backspaces) that
could cause the output to be overwritten by your shell prompt? Try
a "clear; more filename; sleep 10" - see if anything shows before
you get your prompt back.

--
Andrew Smallshaw
andrews@sdf.lonestar.org
Moe Trin

2007-02-20, 1:26 am

On Sun, 18 Feb 2007, in the Usenet newsgroup comp.unix.questions, in article
<slrnethi6b.c8q.andrews@sdf.lonestar.org>, Andrew Smallshaw wrote:

>Many mores will exit immediately if the file is less than a screenful,
>which will probably be the case with an 80 byte file. As for why
>nothing appears, I can't say for sure.


Could the display be being restored, such that when 'more' exits, the
original display is restored?

Old guy
Barry Margolin

2007-02-20, 1:26 am

In article <slrnetkka4.g92.ibuprofin@compton.phx.az.us>,
ibuprofin@painkiller.example.tld (Moe Trin) wrote:

> On Sun, 18 Feb 2007, in the Usenet newsgroup comp.unix.questions, in article
> <slrnethi6b.c8q.andrews@sdf.lonestar.org>, Andrew Smallshaw wrote:
>
>
> Could the display be being restored, such that when 'more' exits, the
> original display is restored?


I thought that the "immediate exit" behavior was the reason that these
versions of more don't switch to the alternate screen.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com