removing EOF character after unix command - Unix

This is a discussion on removing EOF character after unix command - Unix ; Can anyone please throw some light on this issue. When I give a command like ls -ltcr | echo `awk '{print $9}'` i get a list of files in the directory. But there is also an EOF character after the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: removing EOF character after unix command

  1. removing EOF character after unix command

    Can anyone please throw some light on this issue.

    When I give a command like
    ls -ltcr | echo `awk '{print $9}'`

    i get a list of files in the directory. But there is also an EOF
    character after the last file that is displayed in the list.

    Can i get the output without the EOF character.

    FYI, I am giving this command inside DataStage ( a data warehousing
    tool ). There an EOF character is treated as an error.

    Thanks,
    Varun


  2. Re: removing EOF character after unix command

    On Mon, 23 Oct 2006 07:04:52 -0700, ktvarun wrote:

    > Can anyone please throw some light on this issue.
    >
    > When I give a command like
    > ls -ltcr | echo `awk '{print $9}'`
    >
    > i get a list of files in the directory. But there is also an EOF
    > character after the last file that is displayed in the list.
    >
    > Can i get the output without the EOF character.
    >
    > FYI, I am giving this command inside DataStage ( a data warehousing
    > tool ). There an EOF character is treated as an error.
    >
    > Thanks,
    > Varun


    ls -ltcr | echo `awk '{gsub("\nnn","");print $9}'`

    Replace \nnn with the octal sequence for the character you want removed.


  3. Re: removing EOF character after unix command

    In article <1161612292.634281.274860@k70g2000cwa.googlegroups. com>,
    ktvarun@gmail.com wrote:

    > Can anyone please throw some light on this issue.
    >
    > When I give a command like
    > ls -ltcr | echo `awk '{print $9}'`
    >
    > i get a list of files in the directory. But there is also an EOF
    > character after the last file that is displayed in the list.
    >
    > Can i get the output without the EOF character.
    >
    > FYI, I am giving this command inside DataStage ( a data warehousing
    > tool ). There an EOF character is treated as an error.
    >
    > Thanks,
    > Varun


    Unix doesn't have an EOF character, so it's not clear what you're
    talking about. The terminal driver allows you to type a character to
    simulate an EOF condition on a terminal, but AFAIK it never *outputs*
    this character in any end-of-file situation.

    BTW, a simpler way to do the above command would be:

    echo `ls -tcr`

    --
    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 ***

+ Reply to Thread