Skip to main content
  1. Posts/

Bash bashings..

··131 words·1 min·
Tips & How-To's Bash Linux Popd Pushd

Since my new job involves lot more of Linux, shell scripting bash and automation, I’ve been trying to brush up my Linux skills. Ran into this “problem” today where there’s an init script which handles unicorn start/stop/reload and we were debugging some kinks around this. The init script had a chain of cd to the directory and the unicorn invoke script. Was trying to figure out why unicorn wasn’t starting up, till I read a bit more and dropped to using echo to understand what’s happening

This should give an idea. After experimenting with eval, pushd/popd, bash subroutines and some more things, both the Tech Architect and me did a facepalm when we realized… the script does a cd at start we really didn’t need that chaining.

 

(inb4  you-so-n00b etc etc)

Sathyajith Bhat
Author
Sathyajith Bhat
Author, AWS Container Hero and DevOps Specialist.

Related

[How to] Search through Bash history
··84 words·1 min
Tips & How-To's Linux Bash Applications
Quick tip - if you use the Terminal as much as I do, ever been in a situation where you’ve written a particularly long command, and then want to issue that command again but can’t recall it ? Use the history command, and pipe it to grep to search it! history | grep -i <search-term> This will give you all commands with the search term and the corresponding line number.
Reviving my dead Windows 8 install with no bootable USB/DVD and Linux Mint & Cr48
··680 words·4 mins
News Tips & How-To's Cr48 Linux Mint Windows
Couple of months ago, just about a month before #cpgweds - the engagement my Envy 14 laptop started showing signs of dying - weird noises coming from the vents, system freezing arbitrarily, system getting incredibly hot - and that’s really unusual because the Envy’s cooling system is probably one of the best that I’ve seen in a laptop. Soon enough, it became clear that a fan was not working - my idle temperatures hit 85 degrees C, and start any game or even xbmc, and the temperatures would hit 95-100 and shutdown sooner or later.
Am I the only person who gets ln -s the wrong way round every time?
··105 words·1 min
Tips & How-To's Commands Linux
ln -s d1 d2 # Am I the only person who gets this the wrong way round every fucking time? Similar to most people who have posted there - I used to still get it wrong every time. It’s become a habit for me to do a man ln or ln -help before I execute this command :\ Great tip here though: but then I finally found out about the relationship between ln and cp