• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

builtins/H10-Dec-2020-2,2271,754

doc/H03-May-2022-26,28025,853

lineedit/H10-Dec-2020-12,0378,877

po/H03-May-2022-7,4085,878

share/H10-Dec-2020-20,74318,165

tests/H10-Dec-2020-36,01030,652

COPYINGH A D10-Dec-202017.6 KiB340281

INSTALLH A D10-Dec-202013.8 KiB328274

INSTALL.jaH A D10-Dec-202018.2 KiB315262

Makefile.inH A D10-Dec-202011 KiB329286

NEWSH A D10-Dec-202048.5 KiB1,088970

NEWS.jaH A D10-Dec-202054.5 KiB987869

READMEH A D10-Dec-20206 KiB157115

README.jaH A D10-Dec-20208.2 KiB161119

THANKSH A D10-Dec-2020246 95

alias.cH A D10-Dec-202015.8 KiB568396

alias.dH A D10-Dec-2020234 54

alias.hH A D10-Dec-20202.1 KiB7140

arith.cH A D10-Dec-202036.6 KiB1,3701,173

arith.dH A D10-Dec-202092 32

arith.hH A D10-Dec-20201.1 KiB369

builtin.cH A D10-Dec-202018.5 KiB597415

builtin.dH A D10-Dec-2020353 76

builtin.hH A D10-Dec-20202.4 KiB8448

common.hH A D10-Dec-20201.8 KiB6429

configureH A D03-May-202242.9 KiB1,9201,809

exec.cH A D10-Dec-202070 KiB2,5952,009

exec.dH A D10-Dec-2020334 65

exec.hH A D10-Dec-20204.1 KiB13897

expand.cH A D10-Dec-202059.4 KiB1,9941,461

expand.dH A D10-Dec-2020180 43

expand.hH A D10-Dec-20205.6 KiB14076

hashtable.cH A D10-Dec-202013.9 KiB457277

hashtable.dH A D10-Dec-202062 21

hashtable.hH A D10-Dec-20204.3 KiB12477

history.cH A D10-Dec-202050.1 KiB1,8891,393

history.dH A D10-Dec-2020152 43

history.hH A D10-Dec-20203.2 KiB10557

input.cH A D10-Dec-202014.3 KiB499336

input.dH A D10-Dec-2020270 54

input.hH A D10-Dec-20203.5 KiB10951

install-shH A D10-Dec-202013.3 KiB519447

job.cH A D10-Dec-202042 KiB1,4601,089

job.dH A D10-Dec-2020220 54

job.hH A D10-Dec-20204.2 KiB13275

mail.cH A D10-Dec-20207.5 KiB314236

mail.dH A D10-Dec-2020146 32

mail.hH A D10-Dec-2020879 304

makedeps.yashH A D10-Dec-20201.7 KiB7767

makesignum.cH A D10-Dec-20202.8 KiB9862

makesignum.dH A D10-Dec-202055 21

option.cH A D10-Dec-202031.4 KiB959664

option.dH A D10-Dec-2020131 32

option.hH A D10-Dec-20203.2 KiB10571

parser.cH A D10-Dec-2020111.9 KiB4,0313,253

parser.dH A D10-Dec-2020187 43

parser.hH A D10-Dec-202013.9 KiB401249

path.cH A D10-Dec-202053.9 KiB1,9201,435

path.dH A D10-Dec-2020170 43

path.hH A D10-Dec-20204 KiB14489

plist.cH A D10-Dec-20205.4 KiB17692

plist.dH A D10-Dec-202050 21

plist.hH A D10-Dec-20206.8 KiB204118

redir.cH A D10-Dec-202023.7 KiB936697

redir.dH A D10-Dec-2020145 32

redir.hH A D10-Dec-20201.8 KiB6028

refcount.hH A D10-Dec-20201.3 KiB5325

sig.cH A D10-Dec-202042 KiB1,4871,095

sig.dH A D10-Dec-2020291 65

sig.hH A D10-Dec-20202.5 KiB8852

siglist.hH A D10-Dec-20203.7 KiB179133

strbuf.cH A D10-Dec-202019.6 KiB642425

strbuf.dH A D10-Dec-202053 21

strbuf.hH A D10-Dec-202015.8 KiB480337

util.cH A D10-Dec-20207.9 KiB292188

util.dH A D10-Dec-202074 21

util.hH A D10-Dec-20208.4 KiB279187

variable.cH A D10-Dec-202094.2 KiB3,3422,596

variable.dH A D10-Dec-2020336 65

variable.hH A D10-Dec-20207.2 KiB219170

xfnmatch.cH A D10-Dec-202021 KiB772602

xfnmatch.dH A D10-Dec-202068 21

xfnmatch.hH A D10-Dec-20202.2 KiB7041

xgetopt.cH A D10-Dec-202015.4 KiB450244

xgetopt.dH A D10-Dec-202065 21

xgetopt.hH A D10-Dec-20201.3 KiB5425

yash.cH A D10-Dec-202018.1 KiB700549

yash.dH A D10-Dec-2020201 43

yash.hH A D10-Dec-20202.2 KiB8237

README

1Yash: yet another shell
2http://yash.osdn.jp/
3=======================
4
5
6Yash, yet another shell, is a POSIX-compliant command line shell
7written in C99 (ISO/IEC 9899:1999). Yash is intended to be the most
8POSIX-compliant shell in the world while supporting features for daily
9interactive and scripting use. Notable features are:
10
11 * Global aliases
12 * Arrays
13 * Socket redirection, pipeline redirection, and process redirection
14 * Brace expansion and extended globbing
15 * Fractional numbers in arithmetic expansion
16 * Prompt command and command-not-found handler
17 * Command line completion with predefined completion scripts for more
18   than 100 commands
19 * Command line prediction based on command history
20
21Yash can be modified/redistributed under the terms of the GNU General
22Public License (Version 2) but the use of this program is without any
23warranty. See the "COPYING" file for the full text of GPL.
24
25Yash is an OSDN-hosted project. See also the project summary page at
26<https://osdn.net/projects/yash/>.
27
28
29===== Current Development Status =====
30
31Yash now fully supports POSIX.1-2008 (IEEE Std 1003.1, 2016 Edition)
32except for the limitations listed below.
33
34Yash is stable. A maintenance update is released every three months or
35so. For the change history, see the "NEWS" file.
36
37
38===== Requirements =====
39
40Yash is supposed to build and run on any POSIX.1-2001 environment with
41the Software Development Utilities and the C-Language Development
42Utilities options.
43
44Currently, yash is mainly tested on Fedora, macOS, and Cygwin.
45
46
47===== Installation =====
48
49See the "INSTALL" file to see how to build and install yash.
50
51After installation, the manual can be viewed by
52
53  $ man yash
54
55The manual is also available online at <https://yash.osdn.jp/doc/>.
56
57
58===== Basic Configuration =====
59
60Below is a description of basic configuration that you might want to
61see after installation to get started with yash. For configuration
62details, see the manual.
63
64--- Initialization scripts ---
65
66When yash is started as a login shell, it reads ~/.yash_profile. This
67file is a shell script in which you define environment variables using
68the export command.
69
70When yash is started for an interactive use, it reads ~/.yashrc (after
71reading ~/.yash_profile if it is a login shell also). In this file,
72you make other configurations such as aliases, prompt strings, key
73bindings for command line editing, and command-not-found handler.
74Use the "share/initialization/sample" file as a template for your
75~/.yashrc.
76
77--- Making yash your login shell ---
78
79In many Unix-like OSes, a shell must be listed in /etc/shells to be
80set as a login shell. Edit this file and ensure that the path to yash
81is written in the file.
82
83Then, run the "chsh" command in the terminal and follow instructions
84from the command. Depending on your system, you may have to use
85another command to change the login shell. See documentation on your
86system.
87
88
89===== Implementation Notes =====
90
91 * In C, a null character represents the end of a string. If input to
92   the shell itself contains a null character, characters following
93   the null character will be ignored.
94 * We assume that an overflow in signed integer arithmetic or type
95   conversion silently yields an implementation-defined integer value
96   rather than resulting in an error.
97 * The GCC extension keyword `__attribute__' is used in the source
98   code. When not compiled with GCC, this keyword is removed by the
99   preprocessor, so generally there is no harm. But if your compiler
100   uses this keyword for any other purpose, compilation may fail.
101   Additionally, some other identifiers starting with '_' may cause
102   compilation errors on some rare environments.
103 * Some signals are assumed to have the specific numbers:
104     SIGHUP=1 SIGINT=2 SIGQUIT=3 SIGABRT=6
105     SIGKILL=9 SIGALRM=14 SIGTERM=15
106 * POSIX disallows non-interactive shells to ignore or catch SIGTTIN,
107   SIGTTOU, and SIGTSTP by default. Yash, however, ignores these
108   signals if job-control is enabled, even if non-interactive.
109 * File permission flags are assumed to have the specific values:
110     0400=user read    0200=user write   0100=user execute
111     0040=group read   0020=group write  0010=group execute
112     0004=other read   0002=other write  0001=other execute
113 * The character categorization in locales other than the POSIX locale
114   is assumed upward compatible with the POSIX locale.
115 * The -o nolog option is not supported: it is silently ignored.
116 * According to POSIX, the value of variable `PS1' is subject to
117   parameter expansion. Yash performs command substitution and
118   arithmetic expansion as well on the `PS1' value.
119 * According to POSIX, the command `printf %c foo' should print the
120   first byte of string `foo'. Yash prints the first character of
121   `foo', which may be more than one byte.
122 * The "return" built-in, if executed in a trap, can operate only on a
123   function, script, or loop that has been executed within the trap.
124   This limitation is not strictly POSIX-compliant, but needed for
125   consistent and predictable behavior of the shell.
126 * Results of pathname expansion is sorted only by collating sequence
127   of the current locale. If the collating sequence does not have a
128   total ordering of characters, order of uncomparable results are
129   unstable. This limitation is not strictly POSIX-compliant, but
130   inevitable due to use of wide characters in the whole shell.
131
132
133===== Known Issues =====
134
135 * Line number ($LINENO) may not be counted correctly in and after a
136   complex expansion containing a line continuation.
137 * Non-ASCII characters may not be correctly handled in some locales
138   on Solaris. This may be worked around by undefining the
139   HAVE_WCSNRTOMBS macro in the config.h header file.
140
141
142===== Contributions =====
143
144Comments, suggestions, and bug reports are welcome at:
145
146 * Issue tracking system
147   <https://osdn.net/projects/yash/ticket/>
148 * Discussion forum
149   <https://osdn.net/projects/yash/forums/>
150
151If you are interested in translation, please refer to
152<https://osdn.net/projects/yash/wiki/HowToTranslate>.
153
154
155======================
156Watanabe, Yuki <magicant@users.osdn.me>
157

README.ja

1Yash: yet another shell
2http://yash.osdn.jp/
3=======================
4
5
6このプログラムは C 言語 (C99: ISO/IEC 9899:1999, JIS X 3010:2003) で
7書いた Unix 系 OS 用コマンドライン端末シェルです。Yash は世界で最も
8正確な POSIX 規格準拠を目指しながらも、対話シェルおよびシェルスクリプト
9実行プログラムとして便利な機能を備えています。
10
11 * グローバルエイリアス
12 * 配列
13 * ソケットリダイレクト・パイプリダイレクト・プロセスリダイレクト
14 * ブレース展開・拡張パス名展開
15 * 数式展開での小数の計算
16 * プロンプトコマンド
17 * コマンドが見付からないときのハンドラー
18 * コマンドライン補完 (100 個以上のコマンドに対する補完設定付き)
19 * コマンド履歴に基づくコマンドラインの推定
20
21このプログラムは GNU General Public License (Version 2) の元で自由に
22再配布・変更などができます。その代わり、プログラムの利用は全て各自の
23自己責任の下で行っていただくことになります。作者はプログラムの瑕疵に
24対して一切責任を取りません。ライセンスの本文については "COPYING"
25ファイルを参照してください。
26
27このプログラムは OSDN のプロジェクトの一つとして開発されています。
28プロジェクト概要ページは <https://osdn.jp/projects/yash/> にあります。
29
30
31===== 開発状況 =====
32
33Yash は既に POSIX.1-2008 (IEEE Std 1003.1, 2016 Edition) を全てサポート
34しています (ただし下記制限事項を除く)。
35
36Yash は安定しています。バグ修正のためのバージョンアップはおおよそ三箇月
37に一度リリースされます。変更履歴は "NEWS.ja" ファイルにあります。
38
39
40===== 要件 =====
41
42Software Development Utilities オプションと C-Language Development
43Utilities オプションを備えた任意の POSIX.1-2001 環境でビルド・実行
44できるはずです。
45
46今のところ yash の動作は主に Fedora と macOS と Cygwin で検証されて
47います。
48
49
50===== インストール =====
51
52Yash をビルドしインストールする方法については "INSTALL.ja" ファイルを
53参照してください。
54
55インストール後、マニュアルは
56
57  $ man yash
58
59で参照できます。また <https://yash.osdn.jp/doc/ja/> でオンラインで読む
60こともできます。
61
62
63===== 基本設定 =====
64
65以下は、yash を使い始めるにあたって有用な設定の手引きです。設定の詳細は
66マニュアルを参照してください。
67
68--- 初期化スクリプト ---
69
70Yash がログインシェルとして起動されたとき、~/.yash_profile を読み込み
71ます。このファイルはシェルスクリプトとして実行されます。この中で
72export コマンドを使うことで環境変数を設定できます。
73
74Yash が対話シェルとして起動されたとき、(~/.yash_profile も読み込む場合
75はその後で) ~/.yashrc を読み込みます。この中でエイリアス、プロンプト、
76コマンド行編集のキーバインド設定、コマンドが見付からないときのハンドラ
77ー等を設定します。サンプルとして "share/initialization/sample"
78ファイルを参考に自分用の ~/.yashrc を設定してください。
79
80--- Yash をログインシェルにする ---
81
82多くの Unix 系 OS では、ログインシェルとして使用可能なシェルは
83/etc/shells ファイルに名前が挙げられている必要があります。このファイル
84を編集し、yash へのパスがファイルに含まれているようにしてください。
85
86その後、端末で "chsh" コマンドを実行してログインシェルを yash に変更し
87てください。環境によってはこれ以外の方法でログインシェルを設定するよう
88になっているかもしれません。詳しくはお使いの環境のマニュアルを参照くだ
89さい。
90
91
92===== 実装上の注意事項 =====
93
94 * C 言語では、ナル文字は文字列の終わりを表します。そのため、入力した
95   ファイルの内容や文字列にナル文字が含まれているとそれ以降の部分が正
96   しく処理されなくなってしまいます。
97 * 符号付き整数の演算・型変換においてオーバーフローが発生した場合でも
98   エラーにならずに (処理系定義の) 何らかの整数値が返されることを仮定
99   しています。
100 * ソース内の随所で GCC の拡張機能である __attribute__ キーワードを使
101   用しています。GCC 以外の環境ではプリプロセッサによって消去するよう
102   にしていますが、__attribute__ 識別子を他の用途で使用している処理系
103   ではコンパイルに支障をきたすかもしれません。他にもいくつか '_' で始
104   まる識別子を使用しているため、非常に特殊な環境では正しくコンパイル
105   できないかもしれません。
106 * いくつかのシグナルは特定の番号を持っていると仮定しています:
107     SIGHUP=1 SIGINT=2 SIGQUIT=3 SIGABRT=6
108     SIGKILL=9 SIGALRM=14 SIGTERM=15
109 * POSIX は対話的でないシェルが SIGTTIN, SIGTTOU, SIGTSTP をデフォルト
110   で無視・キャッチすることを禁じています。しかし yash はジョブ制御が
111   有効な時は対話的でなくてもこれらのシグナルを無視します。
112 * ファイルアクセス権フラグは特定の値を持っていると仮定しています:
113     0400=user read    0200=user write   0100=user execute
114     0040=group read   0020=group write  0010=group execute
115     0004=other read   0002=other write  0001=other execute
116 * POSIX ロケール以外のロケールでの文字クラスの分類は POSIX ロケールで
117   の分類と上位互換であると仮定しています。
118 * -o nolog オプションには対応していません。(無視されます)
119 * POSIX によると、PS1 変数の値はパラメータ展開されることになっていま
120   す。Yash ではさらに PS1 変数の値に対してコマンド置換と数式展開も行
121   います。これは実装上の都合によるものです。
122 * POSIX によると、コマンド `printf %c foo' は文字列 `foo' の最初のバ
123   イトを出力することになっています。Yash では `foo' の最初の文字を出
124   力するので、出力が複数バイトになることがあります。
125 * トラップの中で return 組込みコマンドを実行しても、トラップの外で
126   実行されている関数やスクリプトを中断・続行させることはできません。
127   この挙動は厳密には POSIX に従っていませんが、予測可能で一貫性のある
128   動作を保つためにこのようになっています。
129 * パス名展開の結果はその時のロケールでの辞書順でソートされます。
130   ロケールの順序定義が全順序でない場合、比較不可能な結果同士の順序は
131   不定です。この挙動は厳密には POSIX に従っていませんが、POSIX
132   ロケールでのバイト単位再比較がワイド文字では不可能なためこのように
133   なっています。
134
135
136===== 既知の問題 =====
137
138 * 行連結を含む複雑な展開があると行番号 ($LINENO) が正しく計算されない
139   ことがあります。
140 * Solaris では一部のロケールで非 ASCII 文字が正しく扱われないことが
141   あります。config.h ヘッダーファイルで HAVE_WCSNRTOMBS マクロの定義
142   を削除してビルドすると問題を回避できるかもしれません。
143
144
145===== お知らせ =====
146
147感想・提案・バグ報告等を歓迎します。ただし、全ての提案やバグ報告に
148応じることを約束するものではありません。
149
150 * 課題管理システム
151   <https://osdn.net/projects/yash/ticket/>
152 * 掲示板
153   <https://osdn.net/projects/yash/forums/>
154
155翻訳に興味がおありの場合は以下のページをご覧ください
156<https://osdn.net/projects/yash/wiki/HowToTranslate>
157
158
159======================
160渡邊裕貴 <magicant@users.osdn.me>
161