You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
617 B
35 lines
617 B
#!/bin/bash |
|
|
|
# set internal field separator, |
|
# saving old one |
|
OIFS="$IFS" |
|
IFS=$'\n' |
|
|
|
MV="mv" |
|
|
|
|
|
[[ -d ~/cyber_bin ]] || mkdir ~/cyber_bin |
|
if [[ "$PATH" != *"~/cyber_bin"* ]]; then |
|
# if script not run yet |
|
PATH="$PATH:~/cyber_bin" |
|
fi |
|
|
|
for file in $(ls -A1 dot_bash_*); do |
|
newname=$(perl -p -e 's#dot_#.#gmi' <<< "$file") |
|
${MV} "$file" ~/"$newname" |
|
done |
|
|
|
${MV} dostuff.sh ~ |
|
for file in $( |
|
ls -1 | |
|
egrep -vi \(init\|license\|readme\|git\|dostuff\) |
|
); do |
|
${MV} "$file" -t ~/cyber_bin/ |
|
done |
|
|
|
# push changes made to PATH |
|
hash -r |
|
source ~/.bash_profile |
|
|
|
# reset internal field separator |
|
IFS="$OIFS" |