Test Within Here Document
I've written the following Bash script, but it always returns files found even when the directory is empty. Can someone point out what I'm doing wrong?
Code:
|
To avoid aliases, change the command to $(/bin/ls -A)
|
Nope, same result. The script returns files found when the directory is empty.
|
This worked for me, empty and not-empty on Centos 6.
Code:
#!/bin/bash Code:
[root@dev]# mkdir /tmp/empty |
That did not working either. The script is getting executed from node-prod-1. In both cases it looks like the (ls -A) command is executing in the directory on node-prod-1, when it should execute in the directory in node-prod-2 via the "ssh node-prod-2 <<EOF"
|
I just figured out my problem. For anyone who comes across this in the future, I needed single quotes around my EOF. Thanks to all who took a look.
Quote:
|
All times are GMT -5. The time now is 01:58 AM. |