Commits

Anton Shestakov committed ec26c70

Save on echo.

  • Participants
  • Parent commits 697f71f

Comments (0)

Files changed (1)

File .bash_prompt

         
         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 REV=${PARENTS[0]}
             local MERGEREV=${PARENTS[1]}