mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 21:31:14 -03:00
Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b7b4b91c6 | ||
|
|
eab6f2f37b | ||
|
|
407a9e2dee | ||
|
|
8d34f74320 | ||
|
|
d7dd30852f | ||
|
|
2e709dc58c | ||
|
|
bd7608a6b7 | ||
|
|
30d98d385c | ||
|
|
3a5eb6151d | ||
|
|
6866f8e6b5 | ||
|
|
ee3f0b19b4 | ||
|
|
eaecb817ca | ||
|
|
9b4cb28c8f | ||
|
|
5932440e49 | ||
|
|
578cde6ec6 | ||
|
|
4cee045967 | ||
|
|
ef618b2626 | ||
|
|
105a256e5a | ||
|
|
b313ba555a |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -1,3 +1,16 @@
|
||||
# fish 3.1.0 (released February 12, 2020)
|
||||
|
||||
Compared to the beta release of fish 3.1b1, fish version 3.1.0:
|
||||
- fixes a regression where spaces after a brace were removed despite brace expansion not occurring (#6564)
|
||||
- fixes a number of problems in compiling and testing on Cygwin (#6549) and Solaris-derived systems such as Illumos (#6553, #6554, #6555, #6556, and #6558);
|
||||
- fixes the process for building macOS packages;
|
||||
- fixes a regression where excessive error messages are printed if Unicode characters are emitted in non-Unicode-capable locales (#6584); and
|
||||
- contains some improvements to the documentation and a small number of completions.
|
||||
|
||||
If you are upgrading from version 3.0.0 or before, please also review the release notes for 3.1b1 (included below).
|
||||
|
||||
---
|
||||
|
||||
# fish 3.1b1 (released January 26, 2020)
|
||||
|
||||
## Notable improvements and fixes
|
||||
|
||||
@@ -24,9 +24,9 @@ OUTPUT_PATH=${FISH_ARTEFACT_PATH:-~/fish_built}
|
||||
|
||||
mkdir -p "$PKGDIR/build" "$PKGDIR/root" "$PKGDIR/intermediates" "$PKGDIR/dst"
|
||||
{ cd "$PKGDIR/build" && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo "$SRC_DIR" && make -j 4 && env DESTDIR="$PKGDIR/root/" make install; }
|
||||
pkgbuild --scripts build_tools/osx_package_scripts --root "$PKGDIR/root/" --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" "$PKGDIR/intermediates/fish.pkg"
|
||||
pkgbuild --scripts "$SRC_DIR/build_tools/osx_package_scripts" --root "$PKGDIR/root/" --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" "$PKGDIR/intermediates/fish.pkg"
|
||||
|
||||
productbuild --package-path "$PKGDIR/intermediates" --distribution build_tools/osx_distribution.xml --resources build_tools/osx_package_resources/ "$OUTPUT_PATH/fish-$VERSION.pkg"
|
||||
productbuild --package-path "$PKGDIR/intermediates" --distribution "$SRC_DIR/build_tools/osx_distribution.xml" --resources "$SRC_DIR/build_tools/osx_package_resources/" "$OUTPUT_PATH/fish-$VERSION.pkg"
|
||||
|
||||
|
||||
# Make the app
|
||||
|
||||
@@ -56,7 +56,7 @@ set -l tabs_opts '
|
||||
'
|
||||
|
||||
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -s l -l language -a '(__bat_complete_languages_and_extensions)' -d 'Set language for syntax highlighting'
|
||||
complete -c bat -n 'not __fish_seen_subcommand_from cache' -f -s L -l list-language -d 'List supported languages for syntax highlighting'
|
||||
complete -c bat -n 'not __fish_seen_subcommand_from cache' -f -s L -l list-languages -d 'List supported languages for syntax highlighting'
|
||||
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -s m -l map-syntax -d 'Map file name/extension to existing syntax'
|
||||
complete -c bat -n 'not __fish_seen_subcommand_from cache' -x -l theme -a '(__bat_complete_themes)' -d 'Set theme for syntax highlighting'
|
||||
complete -c bat -n 'not __fish_seen_subcommand_from cache' -f -l list-themes -d 'List syntax-highlighting themes'
|
||||
|
||||
@@ -31,7 +31,7 @@ function __fish_conda_config_keys
|
||||
end
|
||||
|
||||
function __fish_conda_environments
|
||||
conda env list | string match -rv '^#' | string match -r '^\w+'
|
||||
conda env list | string match -rv '^#' | string match -r '^\S+'
|
||||
end
|
||||
|
||||
# common options
|
||||
|
||||
@@ -123,7 +123,7 @@ end
|
||||
# system utilities.
|
||||
#
|
||||
|
||||
if test -d /usr/xpg4/bin
|
||||
if begin; not set -q FISH_UNIT_TESTS_RUNNING; and test -d /usr/xpg4/bin; end
|
||||
not contains -- /usr/xpg4/bin $PATH
|
||||
and set PATH /usr/xpg4/bin $PATH
|
||||
end
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
# macOS 10.15 "Catalina" has some major issues.
|
||||
# The whatis database is non-existent, so apropos tries (and fails) to create it every time,
|
||||
# which takes about half a second.
|
||||
#
|
||||
# So we disable this entirely in that case.
|
||||
if test (uname) = Darwin
|
||||
set -l darwin_version (uname -r | string split .)
|
||||
# macOS 15 is Darwin 19, this is an issue at least up to 10.15.3.
|
||||
# If this is fixed in later versions uncomment the second check.
|
||||
if test "$darwin_version[1]" = 19 # -a "$darwin_version[2]" -le 3
|
||||
function __fish_complete_man
|
||||
end
|
||||
# (remember: exit when `source`ing only exits the file, not the shell)
|
||||
exit
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_complete_man
|
||||
# Try to guess what section to search in. If we don't know, we
|
||||
# use [^)]*, which should match any section.
|
||||
|
||||
@@ -18,7 +18,7 @@ Description
|
||||
|
||||
``and`` statements may be used as part of the condition in an :ref:`while <cmd-while>` or :ref:`if <cmd-if>` block.
|
||||
|
||||
``and`` does not change the current exit status itself, but the command it runs most likely will. The exit status of the last foreground command to exit can always be accessed using the `$status <index.html#variables-status>`__ variable.
|
||||
``and`` does not change the current exit status itself, but the command it runs most likely will. The exit status of the last foreground command to exit can always be accessed using the :ref:`$status <variables-status>` variable.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
@@ -13,7 +13,7 @@ Synopsis
|
||||
Description
|
||||
-----------
|
||||
|
||||
``bg`` sends `jobs <index.html#syntax-job-control>`__ to the background, resuming them if they are stopped.
|
||||
``bg`` sends :ref:`jobs <syntax-job-control>` to the background, resuming them if they are stopped.
|
||||
|
||||
A background job is executed simultaneously with fish, and does not have access to the keyboard. If no job is specified, the last job to be used is put in the background. If PID is specified, the jobs with the specified process group IDs are put in the background.
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Description
|
||||
|
||||
``bind`` adds a binding for the specified key sequence to the specified command.
|
||||
|
||||
SEQUENCE is the character sequence to bind to. These should be written as `fish escape sequences <index.html#escapes>`__. For example, because pressing the Alt key and another character sends that character prefixed with an escape character, Alt-based key bindings can be written using the ``\e`` escape. For example, :kbd:`Alt+w` can be written as ``\ew``. The control character can be written in much the same way using the ``\c`` escape, for example :kbd:`Control+X` (^X) can be written as ``\cx``. Note that Alt-based key bindings are case sensitive and Control-based key bindings are not. This is a constraint of text-based terminals, not ``fish``.
|
||||
SEQUENCE is the character sequence to bind to. These should be written as :ref:`fish escape sequences <escapes>`. For example, because pressing the Alt key and another character sends that character prefixed with an escape character, Alt-based key bindings can be written using the ``\e`` escape. For example, :kbd:`Alt+w` can be written as ``\ew``. The control character can be written in much the same way using the ``\c`` escape, for example :kbd:`Control+X` (^X) can be written as ``\cx``. Note that Alt-based key bindings are case sensitive and Control-based key bindings are not. This is a constraint of text-based terminals, not ``fish``.
|
||||
|
||||
The default key binding can be set by specifying a ``SEQUENCE`` of the empty string (that is, ``''`` ). It will be used whenever no other binding matches. For most key bindings, it makes sense to use the ``self-insert`` function (i.e. ``bind '' self-insert``) as the default keybinding. This will insert any keystrokes not specifically bound to into the editor. Non- printable characters are ignored by the editor, so this will not result in control sequences being printable.
|
||||
|
||||
@@ -36,7 +36,7 @@ When multiple ``COMMAND``\s are provided, they are all run in the specified orde
|
||||
|
||||
If no ``SEQUENCE`` is provided, all bindings (or just the bindings in the specified ``MODE``) are printed. If ``SEQUENCE`` is provided without ``COMMAND``, just the binding matching that sequence is printed.
|
||||
|
||||
To save custom keybindings, put the ``bind`` statements into `config.fish <index.html#initialization>`__. Alternatively, fish also automatically executes a function called ``fish_user_key_bindings`` if it exists.
|
||||
To save custom keybindings, put the ``bind`` statements into :ref:`config.fish <initialization>`. Alternatively, fish also automatically executes a function called ``fish_user_key_bindings`` if it exists.
|
||||
|
||||
Key bindings may use "modes", which mimics Vi's modal input behavior. The default mode is "default", and every bind applies to a single mode. The mode can be viewed/changed with the ``$fish_bind_mode`` variable.
|
||||
|
||||
|
||||
@@ -16,6 +16,6 @@ Description
|
||||
|
||||
``breakpoint`` is used to halt a running script and launch an interactive debugging prompt.
|
||||
|
||||
For more details, see `Debugging fish scripts <index.html#debugging>`__ in the ``fish`` manual.
|
||||
For more details, see :ref:`Debugging fish scripts <debugging>` in the ``fish`` manual.
|
||||
|
||||
There are no parameters for ``breakpoint``.
|
||||
|
||||
@@ -13,7 +13,7 @@ Synopsis
|
||||
Description
|
||||
-----------
|
||||
|
||||
``disown`` removes the specified `job <index.html#syntax-job-control>`__ from the list of jobs. The job itself continues to exist, but fish does not keep track of it any longer.
|
||||
``disown`` removes the specified :ref:`job <syntax-job-control>` from the list of jobs. The job itself continues to exist, but fish does not keep track of it any longer.
|
||||
|
||||
Jobs in the list of jobs are sent a hang-up signal when fish terminates, which usually causes the job to terminate; ``disown`` allows these processes to continue regardless.
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ Synopsis
|
||||
Description
|
||||
-----------
|
||||
|
||||
``fg`` brings the specified `job <index.html#syntax-job-control>`__ to the foreground, resuming it if it is stopped. While a foreground job is executed, fish is suspended. If no job is specified, the last job to be used is put in the foreground. If PID is specified, the job with the specified group ID is put in the foreground.
|
||||
``fg`` brings the specified :ref:`job <syntax-job-control>` to the foreground, resuming it if it is stopped. While a foreground job is executed, fish is suspended. If no job is specified, the last job to be used is put in the foreground. If PID is specified, the job with the specified group ID is put in the foreground.
|
||||
|
||||
|
||||
Example
|
||||
|
||||
@@ -18,7 +18,7 @@ Description
|
||||
|
||||
By defining the ``fish_breakpoint_prompt`` function, the user can choose a custom prompt when asking for input in response to a :ref:`breakpoint <cmd-breakpoint>` command. The ``fish_breakpoint_prompt`` function is executed when the prompt is to be shown, and the output is used as a prompt.
|
||||
|
||||
The exit status of commands within ``fish_breakpoint_prompt`` will not modify the value of `$status <index.html#variables-status>`__ outside of the ``fish_breakpoint_prompt`` function.
|
||||
The exit status of commands within ``fish_breakpoint_prompt`` will not modify the value of :ref:`$status <variables-status>` outside of the ``fish_breakpoint_prompt`` function.
|
||||
|
||||
``fish`` ships with a default version of this function that displays the function name and line number of the current execution context.
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Description
|
||||
|
||||
By defining the ``fish_prompt`` function, the user can choose a custom prompt. The ``fish_prompt`` function is executed when the prompt is to be shown, and the output is used as a prompt.
|
||||
|
||||
The exit status of commands within ``fish_prompt`` will not modify the value of `$status <index.html#variables-status>`__ outside of the ``fish_prompt`` function.
|
||||
The exit status of commands within ``fish_prompt`` will not modify the value of :ref:`$status <variables-status>` outside of the ``fish_prompt`` function.
|
||||
|
||||
``fish`` ships with a number of example prompts that can be chosen with the ``fish_config`` command.
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ The following options are available:
|
||||
|
||||
- ``-V`` or ``--inherit-variable NAME`` snapshots the value of the variable ``NAME`` and defines a local variable with that same name and value when the function is defined. This is similar to a closure in other languages like Python but a bit different. Note the word "snapshot" in the first sentence. If you change the value of the variable after defining the function, even if you do so in the same scope (typically another function) the new value will not be used by the function you just created using this option. See the ``function notify`` example below for how this might be used.
|
||||
|
||||
If the user enters any additional arguments after the function, they are inserted into the environment `variable list <index.html#variables-lists>`__ ``$argv``. If the ``--argument-names`` option is provided, the arguments are also assigned to names specified in that option.
|
||||
If the user enters any additional arguments after the function, they are inserted into the environment :ref:`variable list <variables-lists>` ``$argv``. If the ``--argument-names`` option is provided, the arguments are also assigned to names specified in that option.
|
||||
|
||||
By using one of the event handler switches, a function can be made to run automatically at specific events. The user may generate new events using the :ref:`emit <cmd-emit>` builtin. Fish generates the following named events:
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Synopsis
|
||||
Description
|
||||
-----------
|
||||
|
||||
``jobs`` prints a list of the currently running `jobs <index.html#syntax-job-control>`__ and their status.
|
||||
``jobs`` prints a list of the currently running :ref:`jobs <syntax-job-control>` and their status.
|
||||
|
||||
jobs accepts the following switches:
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ Fish history recall is very simple yet effective:
|
||||
|
||||
- If you want to reuse several arguments from the same line ("!!:3*" and the like), consider recalling the whole line and removing what you don't need (:kbd:`Alt+D` and :kbd:`Alt+Backspace` are your friends).
|
||||
|
||||
See `documentation <index.html#editor>`__ for more details about line editing in fish.
|
||||
See :ref:`documentation <editor>` for more details about line editing in fish.
|
||||
|
||||
|
||||
How can I use ``-`` as a shortcut for ``cd -``?
|
||||
|
||||
@@ -77,7 +77,7 @@ You can make fish your default shell by adding fish's executable in two places:
|
||||
- add ``/usr/local/bin/fish`` to ``/etc/shells``
|
||||
- change your default shell with ``chsh -s`` to ``/usr/local/bin/fish``
|
||||
|
||||
For for detailed instructions see `Switching to fish <tutorial.html#tut_switching_to_fish>`_.
|
||||
For for detailed instructions see :ref:`Switching to fish <switching-to-fish>`.
|
||||
|
||||
Uninstalling
|
||||
------------
|
||||
|
||||
@@ -1435,7 +1435,6 @@ static bool unescape_string_internal(const wchar_t *const input, const size_t in
|
||||
// The positions of variable expansions or brace ","s.
|
||||
// We only read braces as expanders if there's a variable expansion or "," in them.
|
||||
std::vector<size_t> vars_or_seps;
|
||||
bool brace_text_start = false;
|
||||
int brace_count = 0;
|
||||
|
||||
bool errored = false;
|
||||
@@ -1531,7 +1530,6 @@ static bool unescape_string_internal(const wchar_t *const input, const size_t in
|
||||
// assert(brace_count > 0 && "imbalanced brackets are a tokenizer error, we
|
||||
// shouldn't be able to get here");
|
||||
brace_count--;
|
||||
brace_text_start = brace_text_start && brace_count > 0;
|
||||
to_append_or_none = BRACE_END;
|
||||
if (!braces.empty()) {
|
||||
// If we didn't have a var or separator since the last '{',
|
||||
@@ -1559,17 +1557,13 @@ static bool unescape_string_internal(const wchar_t *const input, const size_t in
|
||||
case L',': {
|
||||
if (unescape_special && brace_count > 0) {
|
||||
to_append_or_none = BRACE_SEP;
|
||||
brace_text_start = false;
|
||||
vars_or_seps.push_back(input_position);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case L'\n':
|
||||
case L'\t':
|
||||
case L' ': {
|
||||
if (unescape_special && brace_count > 0) {
|
||||
to_append_or_none =
|
||||
brace_text_start ? maybe_t<wchar_t>(BRACE_SPACE) : none();
|
||||
to_append_or_none = BRACE_SPACE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1586,9 +1580,6 @@ static bool unescape_string_internal(const wchar_t *const input, const size_t in
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (unescape_special && brace_count > 0) {
|
||||
brace_text_start = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
@@ -404,7 +404,7 @@ void outputter_t::writestr(const wchar_t *str) {
|
||||
|
||||
size_t len = wcstombs(nullptr, str, 0); // figure amount of space needed
|
||||
if (len == static_cast<size_t>(-1)) {
|
||||
debug(1, L"Tried to print invalid wide character string");
|
||||
debug(3, L"Tried to print invalid wide character string");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* widechar_width.h, generated on 2019-05-14.
|
||||
* widechar_width.h, generated on 2020-01-30.
|
||||
* See https://github.com/ridiculousfish/widecharwidth/
|
||||
*
|
||||
* SHA1 file hashes:
|
||||
@@ -30,8 +30,8 @@ enum {
|
||||
|
||||
/* An inclusive range of characters. */
|
||||
struct widechar_range {
|
||||
wchar_t lo;
|
||||
wchar_t hi;
|
||||
uint32_t lo;
|
||||
uint32_t hi;
|
||||
};
|
||||
|
||||
/* Simple ASCII characters - used a lot, so we check them first. */
|
||||
@@ -506,14 +506,14 @@ static const struct widechar_range widechar_widened_table[] = {
|
||||
};
|
||||
|
||||
template<typename Collection>
|
||||
bool widechar_in_table(const Collection &arr, wchar_t c) {
|
||||
bool widechar_in_table(const Collection &arr, uint32_t c) {
|
||||
auto where = std::lower_bound(std::begin(arr), std::end(arr), c,
|
||||
[](widechar_range p, wchar_t c) { return p.hi < c; });
|
||||
[](widechar_range p, uint32_t c) { return p.hi < c; });
|
||||
return where != std::end(arr) && where->lo <= c;
|
||||
}
|
||||
|
||||
/* Return the width of character c, or a special negative value. */
|
||||
int widechar_wcwidth(wchar_t c) {
|
||||
int widechar_wcwidth(uint32_t c) {
|
||||
if (widechar_in_table(widechar_ascii_table, c))
|
||||
return 1;
|
||||
if (widechar_in_table(widechar_private_table, c))
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
#RUN: %fish -Z
|
||||
#CHECKERR: {{.*fish}}: {{unrecognized option: Z|invalid option -- '?Z'?|unknown option -- Z}}
|
||||
#CHECKERR: {{.*fish}}: {{unrecognized option: Z|invalid option -- '?Z'?|unknown option -- Z}|illegal option -- Z}}
|
||||
|
||||
50
tests/checks/braces.fish
Normal file
50
tests/checks/braces.fish
Normal file
@@ -0,0 +1,50 @@
|
||||
#RUN: %fish %s
|
||||
|
||||
echo x-{1}
|
||||
#CHECK: x-{1}
|
||||
|
||||
echo x-{1,2}
|
||||
#CHECK: x-1 x-2
|
||||
|
||||
echo foo-{1,2{3,4}}
|
||||
#CHECK: foo-1 foo-23 foo-24
|
||||
|
||||
echo foo-{} # literal "{}" expands to itself
|
||||
#CHECK: foo-{}
|
||||
|
||||
echo foo-{{},{}} # the inner "{}" expand to themselves, the outer pair expands normally.
|
||||
#CHECK: foo-{} foo-{}
|
||||
|
||||
echo foo-{{a},{}} # also works with something in the braces.
|
||||
#CHECK: foo-{a} foo-{}
|
||||
|
||||
echo foo-{""} # still expands to foo-{}
|
||||
#CHECK: foo-{}
|
||||
|
||||
echo foo-{$undefinedvar} # still expands to nothing
|
||||
#CHECK:
|
||||
|
||||
echo foo-{,,,} # four empty items in the braces.
|
||||
#CHECK: foo- foo- foo- foo-
|
||||
|
||||
echo foo-{,\,,} # an empty item, a "," and an empty item.
|
||||
#CHECK: foo- foo-, foo-
|
||||
|
||||
echo .{ foo bar }. # see 6564
|
||||
#CHECK: .{ foo bar }.
|
||||
|
||||
# whitespace within entries is retained
|
||||
for foo in {a, hello
|
||||
wo rld }
|
||||
echo \'$foo\'
|
||||
end
|
||||
# CHECK: 'a'
|
||||
# CHECK: 'hello
|
||||
# CHECK: wo rld'
|
||||
|
||||
for foo in {hello
|
||||
world}
|
||||
echo \'$foo\'
|
||||
end
|
||||
#CHECK: '{hello
|
||||
#CHECK: world}'
|
||||
@@ -19,8 +19,8 @@ begin
|
||||
cd x
|
||||
pwd
|
||||
end
|
||||
rm -rf $tmp
|
||||
cd $oldpwd
|
||||
rm -rf $tmp
|
||||
|
||||
# Create a test directory to store our stuff.
|
||||
set -l base /tmp/cdcomp_test
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
# Ensure that, if variable expansion results in multiple strings
|
||||
# and one of them fails a glob, that we don't fail the entire expansion.
|
||||
set -l oldpwd (pwd)
|
||||
set dir (mktemp -d)
|
||||
cd $dir
|
||||
mkdir a
|
||||
@@ -12,4 +13,5 @@ set dirs ./a ./b
|
||||
echo $dirs/*.txt
|
||||
# CHECK: ./b/file.txt
|
||||
|
||||
cd $oldpwd
|
||||
rm -Rf $dir
|
||||
|
||||
@@ -14,12 +14,6 @@ echo \'{ hello , world }\'
|
||||
for phrase in {good\,, beautiful ,morning}; echo -n "$phrase "; end | string trim;
|
||||
for phrase in {goodbye\,,\ cruel\ ,world\n}; echo -n $phrase; end;
|
||||
|
||||
# whitespace within entries converted to spaces in a single entry
|
||||
for foo in {a, hello
|
||||
world }
|
||||
echo \'$foo\'
|
||||
end
|
||||
|
||||
# dual expansion cartesian product
|
||||
echo { alpha, beta }\ {lambda, gamma }, | string replace -r ',$' ''
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@ apple orange banana
|
||||
'hello' 'world'
|
||||
good, beautiful morning
|
||||
goodbye, cruel world
|
||||
'a'
|
||||
'hello world'
|
||||
alpha lambda, beta lambda, alpha gamma, beta gamma
|
||||
Meg
|
||||
Jo
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
####################
|
||||
# Comments in odd places don't cause problems
|
||||
|
||||
####################
|
||||
# Brace expansion
|
||||
|
||||
####################
|
||||
# Escaped newlines
|
||||
|
||||
|
||||
@@ -11,21 +11,6 @@ for i in 1 2 # Comment on same line as command
|
||||
end;
|
||||
end
|
||||
|
||||
logmsg Brace expansion
|
||||
echo x-{1}
|
||||
echo x-{1,2}
|
||||
echo foo-{1,2{3,4}}
|
||||
|
||||
echo foo-{} # literal "{}" expands to itself
|
||||
echo foo-{{},{}} # the inner "{}" expand to themselves, the outer pair expands normally.
|
||||
echo foo-{{a},{}} # also works with something in the braces.
|
||||
echo foo-{""} # still expands to foo-{}
|
||||
echo banana # just as a marker
|
||||
echo foo-{$undefinedvar} # still expands to nothing
|
||||
|
||||
echo foo-{,,,} # four empty items in the braces.
|
||||
echo foo-{,\,,} # an empty item, a "," and an empty item.
|
||||
|
||||
logmsg Escaped newlines
|
||||
echo foo\ bar
|
||||
echo foo\
|
||||
|
||||
@@ -6,20 +6,6 @@
|
||||
2a
|
||||
2b
|
||||
|
||||
####################
|
||||
# Brace expansion
|
||||
x-{1}
|
||||
x-1 x-2
|
||||
foo-1 foo-23 foo-24
|
||||
foo-{}
|
||||
foo-{} foo-{}
|
||||
foo-{a} foo-{}
|
||||
foo-{}
|
||||
banana
|
||||
|
||||
foo- foo- foo- foo-
|
||||
foo- foo-, foo-
|
||||
|
||||
####################
|
||||
# Escaped newlines
|
||||
foo bar
|
||||
|
||||
Reference in New Issue
Block a user