1、pwd=`cat $jdbc_file | grep password | awk -F'=' '{print $2}'`
-F ':' (来自百度知道) 就是说输入文本是通过冒号 : 来区分字段的,如果你不用-F声明分隔符,那么awk默认是用空格/tab来分隔字段的。 比如你有 a.txt,内容是 hello world: This is world 如果你用 awk '{print $1, $2}' a.txt 那么得到的是 hello world: 两个字段分别是 hello 和world: 而如果你用 awk -F ':' {print $1, $2}' a.txt 那么得到就是 hello world this is world 两个字段分别是 "hello world" 和 “this is world”了.