-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathcreateHomeLinks.sh
More file actions
executable file
·36 lines (28 loc) · 876 Bytes
/
createHomeLinks.sh
File metadata and controls
executable file
·36 lines (28 loc) · 876 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
#
# Created by Sujay Davalgi
#
# Creates a symbolic links for all the scripts in the folder, in the home folder
# If there are any existing symbolic link files for the scripts, it will delete and create the new one
#
# Usage: ./createHomeLinks.sh
. ./library/mySetup.txt
#rm -rf ~/*.sh
find ~/*.sh -maxdepth 1 -delete
#find -L ~/*.sh
find ~/mySetup.txt -maxdepth 1 -delete
find ~/library -maxdepth 1 -delete
if [ -d "${myShellScripts}" ]; then
if [ -f "${myShellScripts}/*.*~" ]; then
find ${myShellScripts}/*.*~ -delete
fi
fi
presentDirectory=`pwd`
homeFolder=`echo ~`
if [ ! -d "${myShellScripts}" ] & [ "${presentDirectory}" != "${homeFolder}" ]; then
myShellScripts="${presentDirectory}"
fi
chmod +x "${myShellScripts}"/*.sh
ln -s "${myShellScripts}"/*.sh ~/
ln -s "${myShellScripts}/mySetup.txt" ~/
ln -s "${myShellScripts}/library" ~/library