lsz and chgext don't work with filenames that have spaces. And chgext doesn't work if the filenames contain characters interpreted by sed, but you could use "${file%.$1}.$2".
ps -c only prints command names, so you could use `ps -Aco pid,comm | sed 's/^ *//'`. pgrep has also been installed by default since 10.8. -l (long) prints process names, and -a includes ancestors like iTerm:
$ pgrep -ila ite
32894 WriteRoom
8591 iTerm
I beg to differ. lsz and chgext both work fine on filenames with spaces. And granted sed-interpreted filenames would throw it off, but who would use regex symbols in a filename? I do like the mangling plan better than sed, though… I wrote that function before I had a grasp on variable mangling. Excuses.
You're right on psgrep. I had pgrep homebrewed but never noticed the -l option, and didn't look too hard because I've had this function running since long before I knew of it.
I see you edited chgext already, but lsz still doesn't work for me:
$ lsz a\ b.tgz
-bash: [: a: binary operator expected
'a b.tgz' is not a valid file
tar tvf (without a dash) doesn't seem to work either.
Are you in bash? All of the above work for me. I've updated the gists nonetheless, they'll post here as soon as I clear the cache and regenerate.
load more (1 remarks)
"Someday I’ll actually get my entire dotfile setup onto GitHub.."
...I've been telling myself I should do the same (↑) thing for a while as well. While I've got clones of my entire system, I really wish I could *track* all the crazy tweaks I do (from dotfiles to plists, and everything in-between) in case I ever wanted to roll something back.
Have you seen/played with http://boxen.github.com/ at all?
Boxen seems like it could be the perfect solution to manage all of this kind of stuff, but it could also be a deep pit of fiddliness...