Skip to content

simple os-detection with shell script#7

Open
arianao19 wants to merge 2 commits into
sirupsen:masterfrom
arianao19:os-detection
Open

simple os-detection with shell script#7
arianao19 wants to merge 2 commits into
sirupsen:masterfrom
arianao19:os-detection

Conversation

@arianao19

Copy link
Copy Markdown

in response to issue #6, i wrote a simple and minimal way for this.

@arianao19 arianao19 closed this Jul 17, 2020
@arianao19 arianao19 reopened this Jul 17, 2020
Comment thread bin/zkt
. os-detect

case "${grep_command}" in
UNKNOWN*) echo "support only unix system";;

@bew bew Aug 13, 2020

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not put this part in the os-detect file with an exit?
It will not run anyway, and I think it would simplify the zkt{,-raw} scripts

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just got the idea from you, just adding exit $? in the end of os-detect right?to be honest, my knowledge of shell scripts is lacking

Comment thread bin/os-detect
OS_TYPE="$(uname -s)"
case "${OS_TYPE}" in
Linux*) sort_command=sort grep_command=grep;;
Darwin*) sort_command=gsort grep_command=ggrep;;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these don't exist, we'll need to print a warning to install them!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry, I was too late to respond to this. based on 000bbf7#r470224199 i think we could print a warning. and then do exit from os-detect file. is it good?

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

Successfully merging this pull request may close these issues.

4 participants