python -c 处理shell字符串

$test="hello world"

$python -c "print '$test'.split()[1]"

world

 

或者

 

$test="hello world"

$a="$(python -c "print '$test'.split()[1]")"

$echo $a

world

posted @ 2013-09-26 23:57  children  阅读(606)  评论(0编辑  收藏  举报