Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
In both zsh and bash the "command" shell builtin (and its cousin builtin) are helpers for bypassing shell functions or aliases.

Thanks for pointing this out and sorry for not responding sooner. I admit I haven't used command and I should have looked it up first, because of course that changes things - it seems strange to want to call the shell only to tell the shell to not use a builtin or function. As a side note, interestingly, it looks like command is slightly different in the two shells: bash says "Runs command with arguments ignoring any shell function named command. Only shell builtin commands or commands found by searching the PATH are executed." while in zsh: "The simple command argument is taken as an external command instead of a function or builtin and is executed. If the POSIX_BUILTINS option is set, builtins will also be executed but certain special properties of them are suppressed." - another argument for avoiding The problem of "the" default shell.

nysus: What is task? If it's something like Taskwarrior (where apparently task list is a valid command), then my suggestion above is actually wrong because no shell is needed, and you should be using something like system('/usr/bin/task','list') instead. See also my node Calling External Commands More Safely.


In reply to Re^3: Can't exec "command": No such file or directory error by haukex
in thread Can't exec "command": No such file or directory error by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2023-10-02 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?