A few weeks ago, my boss mentiones a little bash script to me that he wrote to switch between a list of directories in CLI without having to remember them all. I thought that seemed like a fun little exercise so I wrote a version myself this morning.
The behaviour is the following:
goto .saves the current path to the available paths.gotolists all paths available for going to and prompts the user to choose one. It thencds to that path.goto -cclears all paths currently saved.goto -rremoves a directory of the user’s choice from the list.goto -hdisplays a helper
The code for this is on my gitlab at rrschafer/goto script. It is a good way to remind myself of the way conditions, math expressions, if and case statements and while loops over file contents work in bash.
Leave a Reply