loading...

re: BASH tricks: The dir stack. VIEW POST

FULL DISCUSSION
 
daniel@noir:/etc/mysql/my.cnf.d $> # Nope! Didn't find what I wanted, guess I need to check the base `my.cnf`.
daniel@noir:/etc/mysql $> cd ..
daniel@noir:/etc/mysql $> # Aha! That had what I needed! Back to work

and

daniel@noir:/etc/mysql/my.cnf.d $> # Nope! Didn't find what I wanted, guess I need to check the base `my.cnf`.
daniel@noir:/etc/mysql $> popd
daniel@noir:/etc/mysql $> # Aha! That had what I needed! Back to work

do not look right.

Should probably look like:

daniel@noir:/etc/mysql/my.cnf.d $> # Nope! Didn't find what I wanted, guess I need to check the base `my.cnf`.
daniel@noir:/etc/mysql/my.cnf.d $> cd ..
daniel@noir:/etc/mysql $> # Aha! That had what I needed! Back to work

and

daniel@noir:/etc/mysql/my.cnf.d $> # Nope! Didn't find what I wanted, guess I need to check the base `my.cnf`.
daniel@noir:/etc/mysql/my.cnf.d $> popd
daniel@noir:/etc/mysql $> # Aha! That had what I needed! Back to work

The directory needs to change as a result of a cd .. or popd.
The preceeding comment line isn't supposed to change the directory.

 

Hi @karlrado - You're 100% correct, thanks for pointing out the erroneous snippets 🏆. I updated the article text with fixes.

code of conduct - report abuse