From 3215fc6bb1b6b234852069c267e2bd5a24fade7b Mon Sep 17 00:00:00 2001 From: Mikko Lehto Date: Mon, 24 Sep 2018 00:36:07 +0300 Subject: [PATCH] remote_shell.sh: script for copying minimal shell profile files --- bin/remote_shell.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 bin/remote_shell.sh diff --git a/bin/remote_shell.sh b/bin/remote_shell.sh new file mode 100755 index 0000000..8691e6f --- /dev/null +++ b/bin/remote_shell.sh @@ -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: