holzschu / holzschu/a-shell

HELP: Change username name

Open
#544 5 comments 0 reactions 0 assignees View on GitHub
fix committed
Dominant language
Perl
Stars
3.9k
Forks
213
Avg merge
1m
Merged PRs (30d)
1

Description

Hi, I want to change my username name to something other than `mobile`. More precisely, I want to have a custom USERNAME on my PS1. I tried including environment variables to PS1 and that only works on dash mode. Is it possible to either change the username so when I use `\u` in the PS1 it shows that or include environment variables in the PS1? I want it to look like the third prompt in the image bellow.
Note: I can’t just hardcode the username to the `~/.bashrc` file cus I want that prompt to change dynamically whenever I change the USERNAME env variable.
In the image bellow the PS1 export command are the following:
1. `export PS1="\033[92m\$USERNAME\033[0m\033[96m@\033[93m\h\033[91m:\033[95m\w\033[91m$\033[0m " `
2. `export PS1="\033[92m\u\033[0m\033[96m@\033[93m\h\033[91m:\033[95m\w\033[91m$\033[0m " `
3. `export PS1="\033[92mvinibretas\033[0m\033[96m@\033[93m\h\033[91m:\033[95m\w\033[91m$\033[0m " `
![1ED3FB2A-79C3-4A1B-884C-A8B955129169](https://user-images.githubusercontent.com/73404538/213624639-1091db62-e9f8-4b02-8841-5b487870a386.jpeg)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.