Stop worrying about your VPN connection dropping and your remote job to get kill. You can work on a remote server from your laptop or desktop in a safe and controlled way by detaching your screen session and reattaching later.
When you attempt to modify a file without write permission on it, you will end-up with a
permission denied error.
$ touch donottouch.txt && sudo chown root donottouch.txt $ cat donottouch.txt $ echo "change stuff" > donottouch.txt -bash: donottouch.txt: Permission denied
Using sudo before echo won’t help since the redirection will still apply within your shell environment. Here is few approaches to this problem.
You just have configured your sudoers to execute some command without password from a ssh connection. Bummer, you just got an error:
sudo: sorry, you must have a tty to run sudo
No panic, there is an easy fix!
If you haven’t been away of the internet for the past few years or if you are an occasional blogger, you must have heard about Markdown. It is a plain text format for writing structured documents. It has been developed in 2004 by John Gruber and widely adopted since then. The problem? A quite ambiguous syntax specification leading to many different implementations.
Looking at downloading a file from a bash script but not sure where to start? Let me show you how to use wget, curl or download files with a shell script using Bash Redirections.