cyber-patriot/init.sh

37 lines
618 B
Bash

#!/bin/bash
# set internal field separator,
# saving old one
OIFS="$IFS"
IFS=$'\n'
MV="mv"
LN="ln"
[[ -d ~/apt_stuff ]] || mkdir ~/apt_stuff
if [[ "$PATH" != *"~/.cyber_bin"* ]]; then
# if script not run yet
PATH="$PATH:~/.cyber_bin"
mkdir ../.cyber_bin
fi
for file in $(ls -A1 .bash_*); do
${MV} "$file" ~
done
for file in $(
ls -1 |
egrep -vi \(init\|license\|readme\|git\)
); do
${LN} "$file" "~/.cyber_bin/$file"
done
[[ ! -f ~/.bashrc ]] && ${LN} ~/.bash_profile ~/.bashrc
# push changes made to PATH
hash -r
source ~/.bash_profile
# reset internal field separator
IFS="$OIFS"