Skip to content

Commit

Permalink
remote_shell.sh: script for copying minimal shell profile files
Browse files Browse the repository at this point in the history
  • Loading branch information
mslehto committed Sep 23, 2018
1 parent a8b5c5c commit 3215fc6
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions bin/remote_shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/sh

#VAR="first line"
#VAR="$VAR"'\n'"second line"

sftpcmd ()
{
src=$1
dst=$2
echo "ls -lnf $dst"
#echo "rm $dst"
echo "put $src $dst"
}

HOST=$1
if [ -z $HOST ]
then
echo -e "Usage:\n\t$0 HOST\n"
exit 13
fi

DOTFILEDIR=dotfiles
DOTFILES="inputrc editrc shrc profile"

batch=''
for f in $DOTFILES
do
cmd=$(sftpcmd "$DOTFILEDIR/$f" ".$f")
batch="$batch"$'\n'"$cmd"
done
batch="$batch"$'\n'"$(sftpcmd "$DOTFILEDIR/vim/vimrc" ".vimrc")"
batch="$batch"$'\n'"$(sftpcmd "$DOTFILEDIR/tmux.conf.simple" ".tmux.conf")"
batch="$batch"$'\n'"bye"

echo -e "batch=>$batch<"
echo -e "$batch" | sftp -b- $HOST:

0 comments on commit 3215fc6

Please sign in to comment.