commands not found on zsh [closed]

It’s evident that you’ve managed to mess up your PATH variable. (Your current PATH doesn’t contain any location where common utilities are located.) Try: PATH=/bin:/usr/bin:/usr/local/bin:${PATH} export PATH Alternatively, for “resetting” zsh, specify the complete path to the shell: exec /bin/zsh or exec /usr/bin/zsh

Is there an Eclipse plugin to run system shell in the Console? [closed]

It exists, and it’s built into Eclipse! Go to the Remote Systems view, and you’ll see an entry for “Local”. Right-click “Local Shells” and choose “Launch Shell.” You can’t launch it directly from the project navigator. But you can right-click in the navigator and choose “Show in Remote Systems view”. From there you can right-click … Read more

How does the #! shebang work?

Recommended reading: The UNIX FAQ: Why do some scripts start with #! … ? The #! magic, details about the shebang/hash-bang mechanism on various Unix flavours Wikipedia: Shebang The unix kernel’s program loader is responsible for doing this. When exec() is called, it asks the kernel to load the program from the file at its … Read more

How do you tell if a string contains another string in POSIX sh?

Here’s yet another solution. This uses POSIX substring parameter expansion, so it works in Bash, Dash, KornShell (ksh), Z shell (zsh), etc. test “${string#*$word}” != “$string” && echo “$word found in $string” A functionalized version with some examples: # contains(string, substring) # # Returns 0 if the specified string contains the specified substring, # otherwise … Read more

Using wget to recursively fetch a directory with arbitrary files in it

You have to pass the -np/–no-parent option to wget (in addition to -r/–recursive, of course), otherwise it will follow the link in the directory index on my site to the parent directory. So the command would look like this: wget –recursive –no-parent http://example.com/configs/.vim/ To avoid downloading the auto-generated index.html files, use the -R/–reject option: wget … Read more

Alternative to `sed -i` on Solaris

It isn’t exactly the same as sed -i, but i had a similar issue. You can do this using perl: perl -pi -e ‘s/find/replace/g’ file doing the copy/move only works for single files. if you want to replace some text across every file in a directory and sub-directories, you need something which does it in … Read more