Geoffrey Garbers Thoughts on everything from PHP to photography

You are currently viewing the post archives for the "Bash" tag. All the posts below have been assigned this tag for easy reference.

Retrieving the current script’s directory in bash

Posted 5 days from now.

When writing bash scripts to run on Linux, it's often useful to perform operations relative to the executing script's current directory. But how do you get the absolute path to this directory? I have a useful little script that will get the current working path for you.

Sending mail through a remote SMTP server in Linux

Posted 6 months from now.

Sending mail through the Linux command line can sometimes be a tricky issue. If you don't know how to set up your own mail server, but have a readily accessible SMTP residing elsewhere, I'll show you how to use a readily-available Debian/Ubuntu package to send your mail through this SMTP server quickly and easily.

Preserving whitespace in bash variables

Posted 3 months from now.

Tweet I’ve been creating some bash scripts for an importer we are running at work. I was looking to do two things with this. Firstly, I wanted to brush up on my knowledge of bash scripting. Secondly, I wanted to improve the notifications sent out from the importer. I managed to get everything working fine. [...]
End