Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-13-2006, 07:36 PM   #1
LQ Newbie
Registered: Jan 2006
Posts: 10

Rep: Reputation: 0
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
Old 01-13-2006, 07:45 PM   #2
Registered: Apr 2005
Distribution: Fedora Core (latest version)
Posts: 156

Rep: Reputation: 30
Are you sure ztest is executable on server b.

chmod +x ztest
Old 01-13-2006, 07:49 PM   #3
LQ Newbie
Registered: Jan 2006
Posts: 10

Original Poster
Rep: Reputation: 0
chmod 0755 ztest

And per my post, when the script directs output to a file, I can see the results in that file.
So I know the script is executing.
I just cannot see any of my commands being echoed.
Old 01-13-2006, 09:03 PM   #4
Registered: Aug 2005
Location: China
Distribution: redhat(Fedora Core)->Debian Sid->Slackware
Posts: 91

Rep: Reputation: 15
I think that's something about FD(file descriptor). That means something about redirection in server b is changed because the default stdout device is Screen, but now it's obvious not. But unfortunately I didnot know which place to do this kinda changes. I am searching for it now.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash scripts do not echo commands sean@responsivedata. Linux - Newbie 9 01-17-2006 10:25 AM
Bash Scripting - echo command question gbhil Programming 2 04-27-2005 07:27 PM
can echo be used for popups in shell scripts run by cron? dr_zayus69 Linux - Software 4 04-12-2005 06:30 PM
Issuing Telnet commands via bash scripts Kaj Programming 2 01-02-2005 11:44 PM
How to echo variables and commands in one line? hindll01 Programming 1 09-10-2004 06:02 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration