AstrobioMike.github.io icon indicating copy to clipboard operation
AstrobioMike.github.io copied to clipboard

Mistake, bug, or typo

Open TomOMaley opened this issue 1 year ago • 3 comments

Hi, thanks for the concise and clear doc about $PATH in https://astrobiomike.github.io/unix/modifying_your_path

I followed all steps but when typing .. my-bin % ./what_time_is_it.sh I get the message zsh: no such file or directory: ./what_time_is_it.sh

I assume that the problem is that it is a "zsh" shell. Changed it to "bash" shell but do not know whether this was the problem - because ... see below

Suggested fix – if any, just reporting what's wrong is super-helpful either way :) There are mistakes in the description. The correct spelling of the sh file with dashes, i.e. "what-time-is-it.sh" whilest in the description it is sometimes written with underscores "what_time_is_it.sh"

TomOMaley avatar Mar 13 '23 20:03 TomOMaley

heya @TomOMaley :)

So, it's possible this is due to macs having zsh as default instead of bash, but two things are making me thinks that's not what's going on. One is that you're getting a "no such file or directory" error, and two is that when i test it in a bash shell and a zsh shell, it works in both for me (which i would expect because the "shebang" at the top is pointing to a specific bash: "#!/bin/bash".

Aaah, i just found what i did to mess with you (and who knows how many others...)

At one point i switched from "what_time_is_it.sh" to "what-time-is-it.sh", but i left some in the middle the old way.

So when you were copying and pasting, it was not finding the file because i had you make it different above.

I'm fixing the page now, please let me know if this works as expected:

./what-time-is-it.sh

And THANK YOU for noting this to me so i could fix this unnecessary confusion i left!

AND EDIT I think maybe you caught this too, because it seems you were editing your response to include it at the same time i was posting this, ha :)

AstrobioMike avatar Mar 13 '23 21:03 AstrobioMike

oh and it's up to you of course, but if you did want to change your default shell, it could be done like this to swap to bash:

chsh -s /bin/bash

or this to swap back to zsh:

chsh -s /bin/zsh

after running it, you'd need to open a new terminal, it won't change the one you run it in 👍

AstrobioMike avatar Mar 13 '23 21:03 AstrobioMike

also adding note to myself that i'll need to add a note/some text either way when talking about the bash_profile @AstrobioMike, update that area

AstrobioMike avatar Mar 13 '23 21:03 AstrobioMike