Fix sh script
This commit is contained in:
parent
46195e4ca4
commit
32dc236a00
1 changed files with 8 additions and 7 deletions
|
@ -16,9 +16,10 @@ source $1/my_configs.vim
|
||||||
catch
|
catch
|
||||||
endtry"
|
endtry"
|
||||||
|
|
||||||
if [ $2 == "--all" ]; then
|
|
||||||
USERS=($(ls -l /home | awk '{if(NR>1)print $9}'))
|
if [ "$2" = "--all" ]; then
|
||||||
for user in ${USERS[*]}; do
|
USERS=$(ls -l /home | awk '{if(NR>1)print $9}')
|
||||||
|
for user in $USERS; do
|
||||||
homepath=$(eval echo "~$user")
|
homepath=$(eval echo "~$user")
|
||||||
IFS=''
|
IFS=''
|
||||||
echo $VIMRC > ${homepath}/.vimrc
|
echo $VIMRC > ${homepath}/.vimrc
|
||||||
|
@ -28,10 +29,10 @@ if [ $2 == "--all" ]; then
|
||||||
echo "Installed the Ultimate Vim configuration successfully! Enjoy :-)"
|
echo "Installed the Ultimate Vim configuration successfully! Enjoy :-)"
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
SELECTED_USERS=(${@:2})
|
SELECTED_USERS=${@:2}
|
||||||
echo "Selected users: ${SELECTED_USERS[@]}"
|
echo "Selected users: $SELECTED_USERS"
|
||||||
for user in ${SELECTED_USERS[@]}; do
|
for user in $SELECTED_USERS; do
|
||||||
homepath=$(eval echo "~$user")
|
homepath=$(eval echo "~/$user")
|
||||||
IFS=''
|
IFS=''
|
||||||
echo $VIMRC > ${homepath}/.vimrc
|
echo $VIMRC > ${homepath}/.vimrc
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
Loading…
Reference in a new issue