The main problem is that if any of the commands fail, they’ll just keep moving on to the next one.
You can get around this by using the && chaining operator.
Like
apt-get install curl && curl … && apt … && …
That’ll get around the worst of copy/pasting long strings, but writing a more robust shell script is a better option if you’re doing it for anything important.
Also, if you’re copy/pasting batches of commands from the Internet, just be aware that hidden text can be snuck into command suggestions, so it’s best to copy paste into a text editor first and make sure you understand what it’s doing before you run it.
The main problem is that if any of the commands fail, they’ll just keep moving on to the next one.
You can get around this by using the && chaining operator.
Like
apt-get install curl && curl … && apt … && …
That’ll get around the worst of copy/pasting long strings, but writing a more robust shell script is a better option if you’re doing it for anything important.
Also, if you’re copy/pasting batches of commands from the Internet, just be aware that hidden text can be snuck into command suggestions, so it’s best to copy paste into a text editor first and make sure you understand what it’s doing before you run it.
nice thank you for teaching me something
The other advantage to writing a script is you can assign a “sudo rule” to your account so you can run it without typing a password.
This would set that one script as passwordless sudo, without compromising the security of other things on the server.
Of course, this is all assuming you’re doing it more than once, and in a more critical environment.
I like you lol! Thank you again mate!