B! 39 0 0 0 シェルスクリプトを書いてる時に$@を使って ハマったのでそれについて。 $@と$* -fや-dの罠 まとめ $@と$* $@はシェルスクリプト 1 ではスクリプトや関数の中で全ての引数を表します。 $ f(){ echo $@;} $ f a b c a b c な感じ。 ここで、次の様なスクリプトを考えてみます。 atmark.sh 1 2 3 4 5 6 #!/usr/bin/env bash if [ "$@" != "" ];then echo "$@" else echo empty fi これを実行してみると $ ./atmark.sh a a $ ./atmark.sh ./atmark.sh: line 2: [: unary operator expected empty! $ ./atmark.sh a b ./atmark.sh: line 2
bashからzshに乗り換えるユーザーを対象に16の違いをまとめました。MacOSもbashからzshに変更になりましたので、zshを使い始めるにあたってのポイントを解説していきます。 はじめに zshとは? 2019年、WWDC19の基調講演でApple社は次にリリースする「MacOS X Catalina」より標準のシェルを「zsh」に変更すると発表しました。そして現在、Macを購入したり最新のバージョンにアップデートしてターミナルを開くとbashではなくzshが起動します。 もともとMacOS Xは当初tcshであったのがv10.3 Pantherよりbashに変更された経緯があり今回それがzshにさらに変更された形になります。 こうなった経緯としてはbashのライセンスとセキュリティによる事情があります。MacOS Mojaveまでに搭載されているbashはバージョンが3で実はこれ
Use zsh as the default shell on your Mac Starting with macOS Catalina, your Mac uses zsh as the default login shell and interactive shell. You can make zsh the default in earlier versions of macOS as well. By default, your Mac uses either zsh or bash as the command-line interpreter for the login shell and interactive shell: zsh (Z shell) is the default shell for all newly created user accounts, st
最終更新 2019-01-27 UNIX/Linux のシェル sh・bash・csh・tcsh のリダイレクトを説明する。ファイルへの出力、コマンド出力を別のコマンドの入力とする、標準入力・標準出力・標準エラー出力、パイプなどもあわせて説明する。
ユーザーのホームディレクトリには、.bash_profileや.bashrcといったファイルがある。どんなファイルがあるかは、-aオプション付きでlsコマンドを実行すると表示される。 $ ls -a ./ .bash_history .bashrc .emacs .rpmmacros rpm/ ../ .bash_logout .canna .emacs-color.el .screenrc tmp/ .Xdefaults .bash_profile .cshrc .emacs.el .xemacs.el この中の.bash_profileと.bashrcは、共にログインしたときに実行される設定用のシェルスクリプトだが、両者にはもちろん違いがある。 .bash_profileは、ログイン時だけに
Bash tips: Colors and formatting (ANSI/VT100 Control sequences) The ANSI/VT100 terminals and terminal emulators are not just able to display black and white text ; they can display colors and formatted texts thanks to escape sequences. Those sequences are composed of the Escape character (often represented by “^[” or “<Esc>”) followed by some other characters: “<Esc>[FormatCodem”. In Bash, the <Es
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く