hiroshi-kubota-rh / minishell Goto Github PK
View Code? Open in Web Editor NEWminishell
minishell
export <文字列(=なし)>
,文字列がすでに存在するshell変数の場合には環境変数への格上げが行われる.export <文字列(=なし)>
,文字列がshell変数として存在しない場合には,一旦shell変数に保存される.文字列への値の代入が行われたら,その代入と同時に環境変数に格上げされる.export <文字列(=あり)>
,key=valueとして最初のイコールで文字列を区切り,環境変数に保存する.export
のみでの実行時には,shell変数をdeclare -x ~
の形で出力export
は1つ以上の引数を取ることが可能で,引数として与えられた文字列内に=
があるかないかでshell変数か環境変数かに保存が行われる.echo "fewa"
やecho fewa test
などで,arg を空白で区切って出力し、最後に改行を出力する.-n
オプションをつけた際には,改行が不要となる.0
である.Not interpret unclosed quotes or special characters which are not required by the subject such as \ (backslash) or ; (semicolon).
(課題文より引用)なので,以下の出力が正しいものとなる$>echo '"` a
'"` a
$>echo test test
test test
$>echo "test test"
test test
$> echo 'test test'
test test
exit
の実行で,$?
に最後に実行したコマンドの終了ステータスを格納し,shellのプログラムを終了する.以下はGuacamoleのbash(GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin18)
Copyright (C) 2007 Free Software Foundation, Inc.)での挙動
-9223372036854775808
~ 9223372036854775807
)範囲の数が与えられた時には,0~255(unsigned charにcast?)に読み替えられたステータスコードが$?
に格納され,bashが終了する.-9223372036854775808
~ 9223372036854775807
)範囲外の数,または,数字以外のものが与えられた場合には以下をを出力し,bashは終了しない$>exit <第二引数>
exit
bash: exit: <第二引数>: numeric argument required
exit
bash: exit: too many arguments
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.