Skip to main content
added 179 characters in body
Source Link
Yunus
  • 1.7k
  • 2
  • 14
  • 19

your variables get evaluated only the first time , you must put them inside the ps1 to be treated literally ffirst time and get evaluated after command execution .

PS1='|me::\W| $( mytest=$PWD;mynext="${PWD##*/}";  mylength=$((${#mytest}+${#mynext})) ; length=$(($mylength+6)) ; printf "\\u2500%.0s" $(seq $length $(tput cols))) \w\n\$'

you can change only 6 if you added stuff to ps1

PS1='|me::\W| $( mytest=$PWD;mynext="${PWD##*/}";  mylength=$((${#mytest}+${#mynext})) ; length=$(($mylength+6)) ; printf "\\u2500%.0s" $(seq $length $(tput cols))) \w\n\$'

you can change only 6 if you added stuff to ps1

your variables get evaluated only the first time , you must put them inside the ps1 to be treated literally ffirst time and get evaluated after command execution .

PS1='|me::\W| $( mytest=$PWD;mynext="${PWD##*/}";  mylength=$((${#mytest}+${#mynext})) ; length=$(($mylength+6)) ; printf "\\u2500%.0s" $(seq $length $(tput cols))) \w\n\$'

you can change only 6 if you added stuff to ps1

Source Link
Yunus
  • 1.7k
  • 2
  • 14
  • 19

PS1='|me::\W| $( mytest=$PWD;mynext="${PWD##*/}";  mylength=$((${#mytest}+${#mynext})) ; length=$(($mylength+6)) ; printf "\\u2500%.0s" $(seq $length $(tput cols))) \w\n\$'

you can change only 6 if you added stuff to ps1