Linux: Fixing shell dotfiles (can correct minor issues with environment, PATH, etc.)

A brief script to reset most of the dotfiles in the home directory of the invoking user.

This script will look for dotfiles in the calling user's homedirectory, move any old ones out of the way, and reset them to the CAE defaults (in ~skel). This can be used to help remedy shell environments that aren't working correctly or missing PATH folders, etc.

To run this, simply copy this script into a file in your home directory, and then run `sh <script-name>`.

#!/bin/sh
dotfiles=".bash_logout .bash_profile .bashrc .cshrc .login .logout"
echo "$dotfiles" | /usr/bin/tr ' ' '\n' | while read file; do
    cd "$HOME" || exit
    [ -e "$file" ] && /usr/bin/mv "$file" "$file.bak"
    /usr/bin/cp "/filespace/s/skel/$file" "$file"
done



Keywordsdotfile shell environment PATH command home homedir default   Doc ID6697
OwnerNoel K.GroupCAE
Created2007-11-11 19:00 CDTUpdated2023-04-06 15:52 CDT
SitesComputer-Aided Engineering
Feedback  0   0