--- a/.bash_prompt Mon Aug 25 14:41:33 2014 +0900
+++ b/.bash_prompt Mon Aug 25 14:54:43 2014 +0900
if [[ "$HG_TRACKED" ]] ; then
local SUM=$(LC_ALL=C hg sum)
- local PARENTS=($(echo "$SUM" | grep -Po '(?<=parent: ).*(?=:)'))
- local BRANCH=$(echo "$SUM" | grep -Po '(?<=branch: ).*$')
- local COMMIT=$(echo "$SUM" | grep -Po '(?<=commit: ).*$')
- local UPDATE=$(echo "$SUM" | grep -Po '(?<=update: ).*$')
+ local PARENTS=($(grep -Po '(?<=parent: ).*(?=:)' <<< "$SUM"))
+ local BRANCH=$(grep -Po '(?<=branch: ).*$' <<< "$SUM")
+ local COMMIT=$(grep -Po '(?<=commit: ).*$' <<< "$SUM")
+ local UPDATE=$(grep -Po '(?<=update: ).*$' <<< "$SUM")
local MERGEREV=${PARENTS[1]}