Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Bash scripts do not echo commands

    I have a bash script named ztest that looks like this:

    ls -lat


    On server A it works fine, and I get a directory listing.

    On server B I get nothing. As though the script did not execute!

    However, I modified the script:

    ls -lat $1 >zresult


    When I execute the following:
    #cat zresult

    I see the directory.
    And if I execute the following:
    #./ztest /etc/init.d/
    #cat zresult

    I see the /etc/init.d/ directory.
    Bottom line: The bash script is executing.
    But I am not getting/seeing any output from the script.
    I have tried echo commands, >stdout, etc. but no such luck!

    I am ssh'd into the server using PuTTY.
    But I have no idea if this is a system configuration issue? A PuTTY issue? Some other issue?

    Any ideas?
    Sean McCoy

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Täby, Sweden
    What if you put an obviously invalid command, like `jifds' in the script? Do you then get the diagnostic message saying that it didn't find jifds?

Posting Permissions

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