U:prompt.sh prevent Termux usage for (can't grep /etc/passwd)
This commit is contained in:
parent
62440de555
commit
6174dab139
1 changed files with 6 additions and 1 deletions
|
@ -20,7 +20,10 @@ p_start() {
|
||||||
}
|
}
|
||||||
|
|
||||||
p_user() {
|
p_user() {
|
||||||
|
if [ -z $TERMUX_VERSION ]
|
||||||
|
then
|
||||||
user=$(grep $USER /etc/passwd | cut -d: -f5)
|
user=$(grep $USER /etc/passwd | cut -d: -f5)
|
||||||
|
fi
|
||||||
if [ -z $user ]
|
if [ -z $user ]
|
||||||
then
|
then
|
||||||
echo -e "${bg_orange}${fg_noir}\u"
|
echo -e "${bg_orange}${fg_noir}\u"
|
||||||
|
@ -61,5 +64,7 @@ p_input() {
|
||||||
|
|
||||||
PROMPT_COMMAND="p_geterr"
|
PROMPT_COMMAND="p_geterr"
|
||||||
|
|
||||||
|
|
||||||
|
echo debug
|
||||||
PS1="$(p_start)$(p_user) \$(p_path) \w \$(p_date) \$(p_err)\$(p_end)\n$(p_input) "
|
PS1="$(p_start)$(p_user) \$(p_path) \w \$(p_date) \$(p_err)\$(p_end)\n$(p_input) "
|
||||||
PS2="$(p_input)"
|
PS2="$(p_input)"
|
||||||
|
|
Loading…
Reference in a new issue