Variables and Environment Variables In Bash

Most programming languages make heavy use of ordinary variables. They also (generally) support using environment variables. Shells like bash - also heavily used for writing shell scripts - have a slightly different audience in mind than normal programming languages. They make heavy use of environment variables. So much so that it can sometimes become blurry whether something is a normal variable or an environment variable. In this post, I will dig into variables and environment variables in shell, particularly bash, to help you understand how to distinguish the two and when to use them. ...

June 25, 2020 · Omair Majid

The magic of file

Ever wonder how file(1)1 works? After reading this post, you should understand all about file and its underpinnings. file Using the file tool is quite simple. It’s just file file-name-1. You can call it with multiple arguments too. Here’s a few examples of running it on my system. $ file document.pdf document.pdf: PDF document, version 1.4 $ file image.jpg image.jpg: JPEG image data, Exif standard: [TIFF image data, big-endian, direntries=7 ...orientation=upper-left, datetime=2019:10:30 21:44:30, width=1740], baseline, precision 8, 2017x961, components 3 $ file video.mp4 video.mp4: ISO Media, MP4 v2 [ISO 14496-14] $ file notes.org notes.org: UTF-8 Unicode text, with very long lines $ file /dev/video0 /dev/video0: character special (81/0) You can already see a few things: ...

June 10, 2020 · Omair Majid