LINUX.ORG.RU

Годный шелл, перешел на него недавно.

z00ke ()

Объясните кто-нибудь, в чем конкретно он лучше баша?

Не троллинга ради, просто интересно =]

neocrust ★★★★★ ()
Ответ на: комментарий от neocrust

Объясните кто-нибудь, в чем конкретно он лучше баша?

Не троллинга ради, просто интересно =]


Одно только completion menu чего стоит, которое bash не умеет.
Чего там говорить уже про остальное?..

blackst0ne ★★★★★ ()
Ответ на: комментарий от blackst0ne

Я думаю пощупать его.

completion menu

На сколько я понял, это выборка из доступных команд по табу, с навигацией посредством клавиатуры?

Чего там говорить уже про остальное?..

Чего-нибудь ещё хорошее есть там?

neocrust ★★★★★ ()
Ответ на: комментарий от neocrust

На сколько я понял, это выборка из доступных команд по табу, с навигацией посредством клавиатуры?

Да.

Чего-нибудь ещё хорошее есть там?

Навскидку: autocd, алиасы по расширениям.

blackst0ne ★★★★★ ()
Ответ на: комментарий от neocrust

Чего-нибудь ещё хорошее есть там?

нормальные дополнения, система алиасов, особенно глобальных, шустрый старт благодаря возможности компиляции стартфайлов в байткод. а в принципе - google://zsh - там все есть

ananas ★★★★★ ()


Changes between 4.2 and 5.0
---------------------------

The following changes first appeared in the 4.3 series of releases;
see also the file Etc/NEWS-4.3.

Here is a summary of the most significant changes:

- Multibyte characters strings are supported throughout the shell.
Various options, editor features, and expansion flags have been
added to aid in using them.

- The following new options have appeared: COMBINING_CHARS,
DEBUG_BEFORE_CMD, HASH_EXECUTABLES_ONLY, HIST_FCNTL_LOCK,
HIST_LEX_WORDS, HIST_SAVE_BY_COPY, MULTIBYTE, NO_MULTI_FUNCDEF,
PATH_SCRIPT, POSIX_ALIASES, POSIX_CD, POSIX_JOBS, POSIX_STRINGS,
POSIX_TRAPS, PROMPT_SP, SOURCE_TRACE.

- Highlighting and colouring of the command line is supported.

- Job control is supported in non-interactive shells and subshells.

- The zshroadmap manual page provides a slightly more helpful
introduction to the shell manual than was previously available.

- There have been some notable enhancements to POSIX comptability
when the shell is in a corresponding emulation (e.g. «emulate sh»).

Expansion (parameters, globbing, etc.) and redirection
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

- The character group tests [[:IDENT:]], [[:IFS:]], [[:IFSSPACE:]],
[[:WORD:]] in patterns allow testing if a character can be
part of an identifier, is an IFS character, is an IFS whitespace
character, or is considered part of the word using the line editor's
logic based on the shell variable WORDCHARS.

- In extended globbing, "(#cN,M)" means «match the preceding group
at least N but no more than M times».

- The glob qualifier P can be used with an argument to add an extra
word before each glob match.

- The syntax ~[...] provides dynamic directory naming by means
of the shell function zsh_directory_name or associated hook functions.
This is useful for expanding paths with many variable components as
commonly found in software development.

- Parameter substitution has the ${NAME:OFFSET} and ${NAME:OFFSET:LENGTH}
syntax for compatibility with other shells (and zero-based indexing
is used to enhance compatibility). LENGTH may be negative to count
from the end.

- The arbitrary limit on parameter subscripts (262144) has been removed.
As it was not configurable and tested in an inconvenient place it
was deemed preferable to remove it completely. The limit was originally
introduced to prevent accidental creation of a large parameter array
by typos that generated assignments along the lines of «12345678=0».
The general advice is not to do that.

- The parameter substitution flag (D) abbreviates directories in parameters
using the familiar ~ form.

- The parameter substitution flag (g) can take delimited arguments o, e and
c to provide echo- and print-style expansion: (g::) provides basic
echo-style expansion; (g:e:) provides the extended capabilities of
print; (g:o:) provides octal escapes without a leading zero; (g:c:)
additionally expands «^c» style control characters as for bindkey.
Options may be combined, e.g. (g:eoc:).

- The parameter substitution flag (m) indicates that string lengths used
calculated by the (l) and (r) flags or the # operator should take
account of the printing width of characters in multibyte mode, whether
0, 1 or more. (mm) causes printing characters to count as 1 and
non-printing chracters to count as 0.

- The parameter substitution flag (q-) picks the most minimal way of
quoting the parameter words, to make the result as readable as possible.

- The parameter substitution flag (Z), a variant of (z), takes arguments
describing how to split a variable using shell syntax: (Z:c:) parses
comments as strings (the default is not to treat comment characters
specially); (Z:C:) parses comments and strips them; (Z:n:) treats
newlines as ordinary whitespace (the default is to turn unquoted
newlines into semicolons; this is now documented).

- The parameter subscript flag (e) forces the argument to be treated
as a string, never a pattern, e.g. ${array[(ie)*]} looks for the
index of the array element containing the literal string «*».

- The operators :| and :* in parameter substitution allow for array
subtraction and intersection in the form ${name:|array}. With the :|
operator, all entries in $name that are also in $array will be removed
from the substitution. Conversely for the :* operation only the
entries that are in both arrays will be substituted.

- Numeric expansions can have a positive or negative step
e.g. «{3..9..2}». Negative start and end of ranges are also now
supported.

- =(<<<...) is optimised to eliminate the need for an external process.
It writes the given string to a file and substitutes the name on the
command line.

- The redirection operations «{myfd}>file» and «{myfd}>&-» open and
close a new file descriptor (at least 10) contained in the shell
variable myfd, which can be written to with «>&$myfd». This allows
arbitrary file descriptors rather than the explicit range 0 to 9.

- New prompt escapes:
%x and %I show source file and line number, useful in $PS4 (the
existing %N and %i show names and lines in the execution environment
rather than the source file).
%F, %K, %f, %k allow colouring of prompts both using ANSI colour names
and values supported by individual terminal emulators.

Builtins and shell functions
-+-+-+-+-+-+-+-+-+-+-+-+-+-+

- Directory-changing builtins take an option -q to suppress side
effects such as printing directories or calling the chpwd hook functions.

- Various enhancements have been made to traps:
- The option DEBUG_BEFORE_CMD is on by default, so DEBUG traps
can be used to debug code about to be run
- $ZSH_DEBUG_CMD in such a trap gives the code to be run
- «setopt ERR_EXIT» in a DEBUG trap causes the code not to be executed

- The «fc» builtin is now more useful non-interactively.

Shell variables (parameters)
-+-+-+-+-+-+-+-+-+-+-+-+-+-+

- New variables:
CORRECT_IGNORE can be set to a pattern to be ignored in spelling correction.
KEYBOARD_HACK defines characters to be ignored if typed unmatched at
the end of the line (an extension of the SUN_KEYBOARD_HACK option,
but note that setting the option will override the variable).
ZSH_PATCHLEVEL provides a unique indication of the code compiled to
make the shell, even between releases.
ZSH_SUBSHELL indicates the subshell level, incremented once per fork, at
which the code is being run.

AX ★★★★★ ()


Options
-+-+-+-

- New options:
COMBINING_CHARS: assume that the terminal displays combining
characters correctly. The shell cannot determine this by itself,
hence the option. This is highly recommended for MacOS X where
file names are stored with accented characters split into basic
and combining characters.
DEBUG_BEFORE_CMD (on by default): execute debug traps before the
code they refer to. This is a change of the default behaviour
as the new behaviour is much more useful.
HASH_EXECUTABLES_ONLY: don't insert non-executable files into the
command hash used e.g. by completion; this is optional as the
resulting behaviour may be very slow on network paths.
HIST_FCNTL_LOCK: Use the system's file locking mechanism instead
of an ad-hoc mechanism for locking history files.
HIST_LEX_WORDS: Perform lexical analysis on history lines read from
files, so the words are more accurately determined. May be very slow.
HIST_SAVE_BY_COPY (on by default): if unset, write a history file in
place by truncating the old one. Only needs to be turned off in
special circumstances.
MULTIBYTE (on by default if available): both variables and editor
command lines are treated as sequences of multibyte characters
rather than raw bytes depending on the locale. May be turned off
within functions to perform bytewise operations.
MULTI_FUNCDEF (on by default): «foo bar () { ... }» defines two
functions. This is often found to be confusing and bug-prone,
so you may want to unset it.
PATH_SCRIPT: search the path for a script specified as the first
argument to the shell on invocation.
POSIX_ALIASES: reserved words are not candidates for alias expansion.
POSIX_CD: make directory changing more POSIX-compatible.
POSIX_JOBS: make job control more POSIX compliant.
POSIX_STRINGS: $'...\0...' always processes \0 as a NULL, but if the
option is set the remainder of the string is ignored.
POSIX_TRAPS: EXIT traps are not executed on return from shell functions.
PROMPT_SP: improves display of lines not ending with newlines when
PROMPT_CR is in effect.
SOURCE_TRACE: print information as files are executed with ".",
«source», or as startup or shutdown files.

Line editor
-+-+-+-+-+-

- Supports multibyte characters, including characters wider than one
screen cell and (with the COMBINING_CHARS option) combining characters.

- New builtin widgets:
arguments-base: allow non-decimal numeric arguments
history-incremental-pattern-search-{backward,forward}: support
patterns in incremental searches.

- New special variables:
region_highlight allows arbitrary highlighting of parts of the
command line; it is maintained dynamically.
UNDO_CHANGE_NO gives a unique record of the current change state of
the command line, for undoing back to a particular point using
the undo widget.
zle_highlight provides master control of highlighting for special
modes, e.g. unprintable characters.
ZLE_LINE_ABORTED records an editor line that was aborted by an error
or C-g. It can be used to recover aborted lines.
ZLE_STATE give miscellaneous information, currently whether the line
editor is in insert or overwrite mode.

- The undo widget takes an argument, a previous value of $UNDO_CHANGE_NO.

Completion
-+-+-+-+-+

- Many new and enhanced completion functions

- New styles:
accept-exact-dirs: suppress path expansion of directory components
that already exist, speeding up completion significantly on slow
network directories.
path-completion: can be used to suppress directory components before
the current one completely, so e.g. /u/b<TAB> only completes after the
«b», not the «u».

- New special variables:
ZLE_REMOVE_SUFFIX_CHARS, ZLE_SPACE_SUFFIX_CHARS provide enhanced
flexibility over suffix removal.

- Matching control, typically handled with the matcher-list style,
supports named character ranges, such as [:upper:], wherever
ranges were allowed, for example 'm:{[:upper:]}={[:lower:]}'.
However, matching control does not yet handle multibyte characters
properly, so this is currently limited to ASCII.

Syntax and compatibility
-+-+-+-+-+-+-+-+-+-+-+-+

- Substitutions of the form ${var:-«$@»} and ${var:+«$@»} now behave
much more like other shells when appropriate (e.g. with the
SH_WORD_SPLIT option).

- Assignments within variable substitutions, such as ${var=value},
are also more compatible with other shells where appropriate.

- The emulate command can now be passed an expression to be evaluated
in a «sticky» emulation, so that functions defined there always
behave in the appropriate emulation.

- «emulate sh» and similar modes have improved compatibility with
respect to deciding whether the shell should exit on errors.

- Signals now accept SIG as part of the name.

Modules
-+-+-+-

- Modules now present «features», specific builtins (b:), parameters
(p:), conditions (c:) and math functions (f:), allowing more control
over what is imported from a module.

- The zsh/curses module provides access to the «curses» screen
manipulation package.

- The zsh/datetime module has a calendar utility, although it is not
as robust as standalone calendar utilities.

- The zsh/newuser module and associated functions has facilities for
setting up startup files for a first-time user.

- The zsh/parameter module contains some new arrays to aid in tracing
of the shell's call stack: $funcsourcetrace and $funcfiletrace.

- The zsh/parameter module provides $usergroups, an associative arrays
whose keys are the names of groups the current user belongs to, with
the group identifier as the corresponding value.

- The zsh/system module has a zsystem builtin which provides file
locking and also a forward-compatible means for testing subcommands
supported.

Internal improvements
-+-+-+-+-+-+-+-+-+-+-

- High resolution timestamps are used internally for certain
comparisons when available.

Add-on functions
-+-+-+-+-+-+-+-+

- The VCS_Info system provides a way of keeping track of the state
of numerous version control systems within the shell.

- cdr etc.: change to a directory from a list that persists between
shell instances, with completion support.

- regexp-replace replaces text in variables using regular expressions;
it may be used by zle function widgets based on the functions
replace-string and replace-string-again to provide regular expression
replacements in the line editor.

AX ★★★★★ ()
Ответ на: комментарий от neocrust

Объяснять лучше на конкретных задачах, и может статься, что тебе никакого профита не будет. А может и будет.
Вот тут у человека была задача, где ему zsh дал возможность делать его дела быстрее и удобнее

zolden ★★★★★ ()

вышел. кому не лень - запилите новость

Там и разрабам то лень новость пилить... Оф.анонса нету.

Кстати,

someuser@somehost $ export PATH=~/bin:$PATH
someuser@somehost $ cat > ~/bin/test << EOF
#!/bin/sh
echo "Hello"
EOF
someuser@somehost $ chmod +x ~/bin/test
someuser@somehost $ te <TAB>

Поправили? От юникода также башню сносит?

iBliss ()
Ответ на: комментарий от iBliss

Которую он упёрто решал через жопу

Что не умалаяет офигенности фичи автокомплита на удалённом хосте

zolden ★★★★★ ()
Ответ на: комментарий от zolden

Что не умалаяет офигенности фичи автокомплита на удалённом хосте

Да я не спорю. Сам на нём с 2004го.

iBliss ()
Ответ на: комментарий от blackst0ne

Как воспроизвести?

Забыть переключится с русской раскладки и набрать вместо ls ды, сказать «йопт», зажать бэкспейс.

iBliss ()
Ответ на: комментарий от iBliss

Ну так в чем проблема настроить, чтобы делался автоматический rehash?

kaktyc ★★★★ ()
Ответ на: комментарий от iBliss

Забыть переключится с русской раскладки и набрать вместо ls ды, сказать «йопт», зажать бэкспейс.


Понял. =)

blackst0ne ★★★★★ ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.