Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Square bracket not found in imap-test.sh #1

Open
kurdtpage opened this issue Feb 13, 2018 · 4 comments
Open

Square bracket not found in imap-test.sh #1

kurdtpage opened this issue Feb 13, 2018 · 4 comments
Assignees

Comments

@kurdtpage
Copy link

Running with Ubuntu 17.10 produces the following:

username@server1:~$ sudo su
root@server1:/home/username# sh ./imap-test.sh
imap-test.sh: 72: imap-test.sh: [[: not found
imap-test.sh: 77: imap-test.sh: [[: not found
IMAP-Server: 
Connection: non-ssl
imap-test.sh: 83: imap-test.sh: [[: not found
    Auth: NO

imap-test.sh: 95: imap-test.sh: [[: not found
Starting the test ... imap-test.sh: 162: imap-test.sh: [[: not found
FINISHED


imap-test.sh: 175: imap-test.sh: [[: not found
telnet  143
S: telnet: Unable to connect to remote host: Invalid argument
S: Trying 0.0.0.143...
C: a1 LOGIN  
@kurdtpage
Copy link
Author

Running as non privileged user:

username@server1:~$ sh smtp-test.sh
smtp-test.sh: 96: smtp-test.sh: [[: not found
smtp-test.sh: 99: smtp-test.sh: [[: not found
smtp-test.sh: 102: smtp-test.sh: [[: not found
SMTP-Server: 
Sender-Email: 
Recipient-Email: 
Connection: non-ssl
smtp-test.sh: 110: smtp-test.sh: [[: not found
    Auth: NO

smtp-test.sh: 122: smtp-test.sh: [[: not found
smtp-test.sh: 152: smtp-test.sh: [[: not found
Starting the test ... smtp-test.sh: 160: smtp-test.sh: cannot create transaction.log: Permission denied
smtp-test.sh: 235: smtp-test.sh: [[: not found
smtp-test.sh: 238: smtp-test.sh: cannot create transaction.log: Permission denied
smtp-test.sh: 165: smtp-test.sh: cannot create transaction.log: Permission denied
smtp-test.sh: 169: smtp-test.sh: [[: not found
smtp-test.sh: 175: smtp-test.sh: cannot create transaction.log: Permission denied
smtp-test.sh: 179: smtp-test.sh: [[: not found
smtp-test.sh: 184: smtp-test.sh: cannot create transaction.log: Permission denied
smtp-test.sh: 189: smtp-test.sh: cannot create transaction.log: Permission denied
smtp-test.sh: 193: smtp-test.sh: cannot create transaction.log: Permission denied
FINISHED


smtp-test.sh: 247: smtp-test.sh: cannot create transaction.log: Permission denied
smtp-test.sh: 248: smtp-test.sh: [[: not found
smtp-test.sh: 251: smtp-test.sh: cannot create transaction.log: Permission denied
smtp-test.sh: 253: smtp-test.sh: cannot create transaction.log: Permission denied
telnet  143
S: telnet: Unable to connect to remote host: Invalid argument
S: Trying 0.0.0.143...
C: a1 LOGIN 

@kurdtpage kurdtpage changed the title Square bracket issue in imap-test.sh Square bracket not found in imap-test.sh Feb 13, 2018
@gerhard-tinned gerhard-tinned self-assigned this Feb 14, 2018
@gerhard-tinned
Copy link
Member

I could verify this behaviour on Ubuntu 16.04.

I will investigate into this. In the meantime, you can start the script using bash as the shell.

Thanks for reporting this issue.

@gerhard-tinned
Copy link
Member

I developed this shell script as a bash shell script. Interestingly RHEL and CentOS reference the "sh" to "bash" which allows users on those distributions to call the script with "sh" as the shell.

On Debian and its deriving distributions it seems that "sh" is linked to "dash". Apparently, dash interprets the brackets differently then bash.

I will check if it is possible to modify the script in a way it runs on both shells.

In the meantime, where you able to start the script using "bash" as the shell?

@kurdtpage
Copy link
Author

Yes it works with bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants