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

date: invalid option -- 'D' #22

Open
karawitan opened this issue Jun 5, 2022 · 1 comment
Open

date: invalid option -- 'D' #22

karawitan opened this issue Jun 5, 2022 · 1 comment

Comments

@karawitan
Copy link

Hello,

thanks for sharing this very useful set of scripts.
When running tracker-add-auto-router.sh, I hit the following issue:

m1:tracker-add kalou$ ./tracker-add-auto-router.sh
date: illegal option -- d
usage: date [-jnRu] [-r seconds|file] [-v[+|-]val[ymwdHMS]]
            [-I[date | hours | minutes | seconds]]
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
m1:tracker-add kalou$

date -D is not supported by:

  • gdate (gnu date)
m1:tracker-add kalou$ /opt/homebrew/Cellar/coreutils/9.1/bin/gdate -D
/opt/homebrew/Cellar/coreutils/9.1/bin/gdate: invalid option -- 'D'
Try '/opt/homebrew/Cellar/coreutils/9.1/bin/gdate --help' for more information.
  • the default date utility for Darwin
m1:tracker-add kalou$ type date
date is hashed (/bin/date)
m1:tracker-add kalou$ date -D
date: illegal option -- D
usage: date [-jnRu] [-r seconds|file] [-v[+|-]val[ymwdHMS]]
            [-I[date | hours | minutes | seconds]]
            [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
  • the date utility included in the docker container:
m1:tracker-add kalou$ docker exec -it $(docker run --net=host -d -e HOSTPORT=localhost:9091 -e TR_AUTH=user:password --name=transmission-tracker-add andrewmhub/transmission-tracker-add:latest) bash
bash: /dev/null/.bashrc: Not a directory
bash-5.1$ date -D
date: invalid option -- 'D'
Try 'date --help' for more information.

How may we fix this ?

@AndrewMarchukov
Copy link
Owner

-D option for sh, not bash
-d option for bash, not sh

tracker-add-auto.sh - for bash
tracker-add-auto-router.sh - for clear sh

you don't need fix anything just use right shell and right script

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