M
M
madwayz13372018-08-05 17:21:12
linux
madwayz1337, 2018-08-05 17:21:12

How to make automatic input of a set of commands in a script?

#!/bin/bash -e
cd "$(dirname "$0")"

test -e compiled || mkdir compiled

if ; then
  for sourcefile in "[email protected]"
  do
    smxfile="`echo $sourcefile | sed -e 's/\.sp$/\.smx/'`"
    echo -e "\nCompiling $sourcefile..."
    ./spcomp $sourcefile -ocompiled/$smxfile
    lftp user:[email protected]
    cd /addons/sourcemod/plugins && mput /home/sm/compiled/$smxfile
  done
else
  for sourcefile in *.sp
  do
    smxfile="`echo $sourcefile | sed -e 's/\.sp$/\.smx/'`"
    echo -e "\nCompiling $sourcefile ..."
    ./spcomp $sourcefile -ocompiled/$smxfile
    lftp user:pass:[email protected] | cd /addons/sourcemod/plugins && mput /home/sm/compiled/$smxfile
  done
fi


Command to enter: cd /addons/sourcemod/plugins && mput /home/sm/compiled/smxfile.smx

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
planc, 2018-08-05
@madwayz1337

pipe to the other side
what for ftp when there is ssh ?

scp /мой/файл [email protected]:/куда/заливать/ -i ~/.ssh/мой_ключ

R
Rsa97, 2018-08-05
@Rsa97

expect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question