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

unexpected operator while running this script #5

Open
DaDenniX opened this issue Mar 18, 2016 · 1 comment
Open

unexpected operator while running this script #5

DaDenniX opened this issue Mar 18, 2016 · 1 comment

Comments

@DaDenniX
Copy link

Hi,

I tried this script without any arguments (only -d was given). Everytime I run this script I got an error, it doesn't matter how many files there were in this directory:

  • without files:
    $ ./check_file_ages_in_dirs.sh -d /tmp/test/
    ./check_file_ages_in_dirs.sh: 341: [: unexpected operator
    OK: 1 dir(s) -- /tmp/test/: 0 files
  • with one file:
    $ ./check_file_ages_in_dirs.sh -d /tmp/test/
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 341: [: unexpected operator
    OK: 1 dir(s) -- /tmp/test/: 1 files
  • with two files:
    $ ./check_file_ages_in_dirs.sh -d /tmp/test/
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 341: [: unexpected operator
    OK: 1 dir(s) -- /tmp/test/: 2 files
  • with three files:
    $ ./check_file_ages_in_dirs.sh -d /tmp/test/
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 336: [: unexpected operator
    ./check_file_ages_in_dirs.sh: 341: [: unexpected operator
    OK: 1 dir(s) -- /tmp/test/: 3 files

... and so on :)

I am using a bash with Ubuntu 15.10. Do you need something more?

Thanks in advance!

@thehunmonkgroup
Copy link
Owner

Most likely because Ubuntu uses dash for /bin/sh.

I've rolled a new release which restores the dependency on the bash shell, try that and see if it fixes your issue.

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

No branches or pull requests

2 participants