A while ago I wrote this loop in a zsh script, and now I don't remember what it does, and I need to convert this script to run in sh.
for f in ${HOME}/.dotfiles/files/*(N) ${HOME}/.dotfiles/files/.*(N); do symlink_prompt $(basename $f) done Can someone help me understand what this does, and how I can duplicate it in sh syntax?
for f in .* *; do symlink_prompt $(basename $f) ; done(N)modifier of zsh. You can leave out the modifier, but if you have no matches for the pattern, you will get an message on stderr, and you will need to test inside the loop for the existence of the file. Also, in Posix shell you need to write$(basename "$f"), just in casefcontains white space.