Deprecated: Function get_magic_quotes_gpc() is deprecated in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 99

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 619

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1169

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176

Warning: Cannot modify header information - headers already sent by (output started at /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php:99) in /hermes/walnacweb04/walnacweb04ab/b2791/pow.jasaeld/htdocs/De1337/nothing/index.php on line 1176
8000 Use portable "command -v" to detect installed programs by eli-schwartz · Pull Request #765 · travis-ci/travis.rb · GitHub
Nothing Special   »   [go: up one dir, main page]

Skip to content

Conversation

eli-schwartz
Copy link
Contributor

The "which" utility is not guaranteed to be installed either, and if it is, its behavior is not portable either.

Conversely, the "command -v" shell builtin is required to exist in all POSIX 2008 compliant shells, and is thus guaranteed to work everywhere.

Examples of open-source shells likely to be installed as /bin/sh on Linux, which implement the 11-year-old standard: ash, bash, busybox, dash, ksh, mksh and zsh.

See:
https://mywiki.wooledge.org/BashFAQ/081
https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then/85250#85250

The "which" utility is not guaranteed to be installed either, and if it
is, its behavior is not portable either.

Conversely, the "command -v" shell builtin is required to exist in all
POSIX 2008 compliant shells, and is thus guaranteed to work everywhere.

Examples of open-source shells likely to be installed as /bin/sh on
Linux, which implement the 11-year-old standard: ash, bash, busybox,
dash, ksh, mksh and zsh.

See:
https://mywiki.wooledge.org/BashFAQ/081
https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then/85250#85250
@eli-schwartz
Copy link
Contributor Author

Note: I haven't the foggiest clue why this is executing a system() command line in a shell. Does ruby not have a standard library implementation of e.g. python's shutil.which() that natively iterates over the $PATH and stats for a matching file?

@eli-schwartz
Copy link
Contributor Author

This will simply think nothing ever exists by default, since "which" doesn't exist, but for extra bonus breakage if you do have a version of which, but one that returns 0 even when the command is not found (while emitting human-readable messages), you get this highly amusing Linux error:

$ travis report
Traceback (most recent call last):
	18: from /usr/bin/travis:23:in `<main>'
	17: from /usr/bin/travis:23:in `load'
	16: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/bin/travis:18:in `<top (required)>'
	15: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/cli.rb:62:in `run'
	14: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/cli/parser.rb:36:in `new'
	13: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/cli/parser.rb:36:in `new'
	12: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/cli/api_command.rb:43:in `initialize'
	11: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client.rb:34:in `new'
	10: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client.rb:34:in `new'
	 9: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:36:in `initialize'
	 8: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:36:in `each_pair'
	 7: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:36:in `block in initialize'
	 6: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:36:in `public_send'
	 5: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:50:in `agent_info='
	 4: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:270:in `set_user_agent'
	 3: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/tools/system.rb:73:in `description'
	 2: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/tools/system.rb:33:in `full_os'
	 1: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/tools/system.rb:42:in `os_name'
/usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/tools/system.rb:42:in ``': No such file or directory - sw_vers (Errno::ENOENT)

@BanzaiMan BanzaiMan merged commit d60ef2c into travis-ci:master Sep 3, 2020
@eli-schwartz eli-schwartz deleted the portable-command-v branch September 3, 2020 18:21
@PaulinaParangerHr
Copy link

This will simply think nothing ever exists by default, since "which" doesn't exist, but for extra bonus breakage if you do have a version of which, but one that returns 0 even when the command is not found (while emitting human-readable messages), you get this highly amusing Linux error:

$ travis report
Traceback (most recent call last):
	18: from /usr/bin/travis:23:in `<main>'
	17: from /usr/bin/travis:23:in `load'
	16: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/bin/travis:18:in `<top (required)>'
	15: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/cli.rb:62:in `run'
	14: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/cli/parser.rb:36:in `new'
	13: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/cli/parser.rb:36:in `new'
	12: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/cli/api_command.rb:43:in `initialize'
	11: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client.rb:34:in `new'
	10: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client.rb:34:in `new'
	 9: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:36:in `initialize'
	 8: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:36:in `each_pair'
	 7: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:36:in `block in initialize'
	 6: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:36:in `public_send'
	 5: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:50:in `agent_info='
	 4: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/client/session.rb:270:in `set_user_agent'
	 3: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/tools/system.rb:73:in `description'
	 2: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/tools/system.rb:33:in `full_os'
	 1: from /usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/tools/system.rb:42:in `os_name'
/usr/lib/ruby/gems/2.7.0/gems/travis-1.9.1/lib/travis/tools/system.rb:42:in ``': No such file or directory - sw_vers (Errno::ENOENT)

None

@ghost
Copy link
ghost commented Mar 10, 2021

UaezapHKqfZ_ACyu6WOU1Q

@ghost
Copy link
ghost commented Mar 10, 2021

💯

@ghost
Copy link
ghost commented Mar 10, 2021

11903_uhd

@ghost
Copy link
ghost commented Mar 10, 2021

Commit

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.

3 participants

0