Yahoo Search Búsqueda en la Web

Resultado de búsqueda

  1. 27 de oct. de 2021 · the intent is to execute the command that follows the &&only if the first command is successful. This is idiomatic of Posix shells, and not only found in Bash. It intends to prevent the running of the second process if the first fails. You may notice I've used the word "intent" - that's for good reason.

  2. 18 de oct. de 2013 · 57. The =~ operator is a regular expression match operator. This operator is inspired by Perl's use of the same operator for regular expression matching. The [ [ ]] is treated specially by bash; consider that an augmented version of [ ] construct: [ ] is actually a shell built-in command, which, can actually be implemented as an external command.

  3. 27 de sept. de 2015 · Here-strings in bash are implemented via temporary files, usually in the format /tmp/sh-thd.<random string>, which are later unlinked, thus making them occupy some memory space temporarily but not show up in the list of /tmp directory entries, and effectively exist as anonymous files, which may still be referenced via file descriptor by the shell itself, and that file descriptor being ...

  4. 14 de sept. de 2012 · In Bash, there appear to be several variables which hold special, consistently-meaning values. For instance, ./myprogram &amp;; echo $! will return the PID of the process which backgrounded myprog...

  5. 10 de oct. de 2010 · Just from reading that I would have never understood that "$@" expands into a list of separate parameters. Whereas, "$*" is one parameter consisting of all the parameters added together. If it still makes no sense, do this. Bash special parameters explained with four example shell scripts. edited Jun 9, 2021 at 21:33.

  6. 3 de abr. de 2012 · In brief, $@ expands to the arguments passed from the caller to a function or a script. Its meaning is context-dependent: Inside a function, it expands to the arguments passed to such function. If used in a script (outside a function), it expands to the arguments passed to such script. $ cat my-script. #! /bin/sh.

  7. 1 de ago. de 2019 · 380. This is the exit status of the last executed command. For example the command true always returns a status of 0 and false always returns a status of 1: true echo $? # echoes 0 false echo $? # echoes 1. From the manual: (acessible by calling man bash in your shell) Expands to the exit status of the most recently executed foreground pipeline.

  8. In bash, && and || have equal precendence and associate to the left. See Section 3.2.3 in the manual for details. So, your example is parsed as $ (echo this || echo that) && echo other And thus only the left-hand side of the or runs, since that succeeds the right-hand side doesn't need to run.

  9. Ah yes, I suspected this was from set but wanted to see it in the manual. I was wondering why I didn't see it in man bash, it's because I went straight to the options listed and missed the paragraph that said "All of the single-character shell options documented in the description of the set builtin command, including -o, can be used as options when the shell is invoked".

  10. Modern shells such as Bash and Zsh have inherited this construct from Ksh, but it is not part of the POSIX specification. If you're in an environment where you have to be strictly POSIX compliant, stay away from it; otherwise, it's basically down to personal preference. Note that the arithmetic substitution expression $((...

  1. Otras búsquedas realizadas