I have an assignment and I'm confused which bash configuration file to edit.
I'm supposed to edit a bash configuration file and change the PS1 prompt and add an environment variable that searches ~/scripts whenever a root user enters a command. I am then supposed to copy it to the appropriate directory so all new created users will also have the variables.
I can do the first part fine, but am not sure which configuration file I am supposed to be editing. Based on the second requirement, I'm editing ~/.bashrc, but then I'm stuck on the second part of which directory to copy to.
NDG says that all files in that directory with a .sh extension are automatically executed in /etc/profile.d/, so I went ahead and copy/renamed ~/.bashrc to something like bashrc.sh there. But when I test it with a new user profile, there is an empty prompt in terminal.
Hopefully someone here can help me, thanks.
The exact wording of the assignment
- In the appropriate bash shell configuration file, configure the primary command line prompt so that it displays your surname, followed by @, the host name, and the working directory.
- Create a directory named ~/scripts
- In the appropriate bash shell configuration file, change the appropriate environment variable so that the system also searches the newly created ~/scripts directory when the root user enters a command.
- Copy the bash shell configuration file that you modified the steps above, to the appropriate directory so that whenever a new user is created, that user will also have these environment variable values.