Results 1 to 11 of 11
  1. #1
    Join Date
    Oct 2004
    Posts
    6

    Unanswered: ksh93 & Here document

    Hi,

    I am having a problem with the Here doucment under ksh93. A simple script:

    cat << EOF
    testing 123
    EOF

    This runs fine under ksh, under ksh93 there's no output.

    Has anyone run into this problem?

    Thanks,
    David

  2. #2
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    remove space between '<<' and 'EOF'
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  3. #3
    Join Date
    Oct 2004
    Posts
    6
    thanks for the suggestion. now the script looks:
    cat <<EOF
    testing 123
    EOF

    still does not work under ksh93.

    Thanks.

  4. #4
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    what do you expect it to do AND what is it doing now?
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  5. #5
    Join Date
    Oct 2004
    Posts
    6
    put this into a scipt & run:
    cat <<EOF
    testing 123
    EOF


    under ksh you get 1 line of output:
    testing 123

    under ksh93 there's no output.

    Thanks
    David

  6. #6
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    how do you run it undet ksh93?
    When you 'put this ina script'.... do you specify '#!/pathTOksh93' as the interpreter?
    Or you simply don't specify the interpreter at all and run the 'script' from the ksh93 command prompt?

    On the related note: are you sure however you run script under ksh93 it [script] is actually using /bin/cat? Check your $PATH and aliases for ksh93 - you might b eusing some other 'cat' [no pun intended].
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  7. #7
    Join Date
    Oct 2004
    Posts
    6
    I included the path, please try :

    #!/bin/ksh
    /usr/bin/cat <<EOF
    testing 123
    EOF

    and

    #!/bin/ksh93
    /usr/bin/cat <<EOF
    testing 123
    EOF

  8. #8
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    sorry, I don't have k93 here, but on Solaris /usr/dt/bin/dtksh I think IS ksh93 and it works ok.

    just for kicks... try:

    #!/bin/ksh93
    /usr/bin/cat - <<EOF
    testing 123
    EOF

    What OS are you on anyway?
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  9. #9
    Join Date
    Oct 2004
    Posts
    6
    still did not display anything.
    we are on AIX 5.2.

    thanks for the help anyway. I apprciate your kindness in helping.

  10. #10
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    this is VERY strange - unfortunately I don't have AIX where I'm.
    I assume you've already checked for any 'invisiable' characters leading to the closing 'EOF' and to the openning 'EOF'.

    This is a wild guess, but I'd try using a single character say '!' instead of 'EOF' - I'm grasping for straws, but.... This is something extremely basic for ANY shell.
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  11. #11
    Join Date
    Jun 2002
    Location
    UK
    Posts
    525
    I have absolutely no problem running this in ksh93 on AIX version 4...

    $which ksh93
    /usr/bin/ksh93
    $ksh93
    $cat << EOF
    > testing 123
    > EOF
    testing 123
    $echo $0
    ksh93
    $

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •