2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Bashメモ

2
Last updated at Posted at 2014-07-06

mount

mount -t vboxsf -o uid=xxx,gid=xxx,dmode=0777,fmode=0777 name /dir/name

prompt

export MYSQL_PS1="(\u@\h) [\d]> "
git-prompt
source ~/.git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
export PS1='[\033[32m]\u@\h[\033[00m] : [\033[33m]\W[\033[31m]$(__git_ps1)[\033[00m] $ '

Bash基礎##

参考資料bash 超プログラム術

存在チェック###

-e | -a 存在チェック(whatever file or directory)
-f ファイル存在チェック
-d フォルダー存在チェック
例: ファイルの存在を確認する方法

サイズチェック

-s ファイルサイズ > 0

文字列チェック

-n str strがnullではない(長さが0より大きい)
-z str strがnullである(長さが0)

複数行入力

cat << EOF
EOF
read -d '' help <<- EOF
EOF

下記のも参考できる
Bashメモ
bash による初歩のプログラミングの続編
Bash スクリプトを書くための小技集

実行ファイルのdirectory

echo $(cd $(dirname $0);pwd)

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?