-2

I have few dedicated servers and couple VPS'es. I have to perform a list of copy paste commands (mostly) on all of them.

Total commands are around 18, a few of them require manual entry my me though.

So how to create or achieve such thing? I believe I'll have to create a .sh script? But how?

Most of the commads are like "wget install -zip"

Install unzip
Install etc

Wget abc.com/file.zip
Unzip file.zip
Cd file
Sh run.sh

Etc

0

There is several options <command1>; <command2>; <command3> so split commands with semicolon, then next command will be executed when previous finish.

Second option is to split with && <command1>&& <command2>&& <command3>, then next command will be executed when previous finish with success.

And next option is to write bash script, but in your case you should write script, starting from:

#!/bin/bash <execute first command> <execute second command> <execute third command>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.