Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

shoptコマンドでbashの機能を拡張する

shoptコマンドはbashの秘められた性能を解放します。

実際のところ

オプションなしでコマンドを実行すると、解放可能なもののリストが表示されます。

$ shopt 
cdable_vars    	off
cdspell        	off
checkhash      	off
checkwinsize   	on
cmdhist        	on
compat31       	off
dotglob        	off
execfail       	off
expand_aliases 	on
extdebug       	off
extglob        	off
extquote       	on
failglob       	off
force_fignore  	on
gnu_errfmt     	off
histappend     	off
histreedit     	off
histverify     	off
hostcomplete   	on
huponexit      	off
interactive_comments	on
lithist        	off
login_shell    	on
mailwarn       	off
no_empty_cmd_completion	off
nocaseglob     	off
nocasematch    	off
nullglob       	off
progcomp       	on
promptvars     	on
restricted_shell	off
shift_verbose  	off
sourcepath     	on
xpg_echo       	off

以前の記事で紹介したextglob以外にもhistryやらfilepathやらを拡張する機能がそろっています。