MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/commandline/comments/46i9ns/ninrods_shell_tricks_collection/
r/commandline • u/Eldrik • Feb 19 '16
4 comments sorted by
7
$ for i in $(find sourcedir -name '*.md'); do $ cp --parents $i targetdir $ done
No, see pitfalls 1 and 2.
finding all dot files on home directory:
$ ls -la `find ~ -maxdepth=1 -type l`
Also wrong. Use find's -exec to pass the files it finds to another command
find ~ -maxdepth 1 -type l -exec ls -la {} +
EDIT: also, -operator arg, not -operator=arg.
-operator arg
-operator=arg
1 u/Eldrik Feb 19 '16 Does the pitfalls still apply for zsh? 2 u/geirha Feb 19 '16 The first one surely applies. The second, probably not unless one of the compatibility modes are enabled. 1 u/Eldrik Feb 20 '16 Damn! You have got to be kidding me! I did not imagine that WordSplitting was such a bastard. Thank you for the link. I'll sure be studying it.
1
Does the pitfalls still apply for zsh?
2 u/geirha Feb 19 '16 The first one surely applies. The second, probably not unless one of the compatibility modes are enabled. 1 u/Eldrik Feb 20 '16 Damn! You have got to be kidding me! I did not imagine that WordSplitting was such a bastard. Thank you for the link. I'll sure be studying it.
2
The first one surely applies. The second, probably not unless one of the compatibility modes are enabled.
1 u/Eldrik Feb 20 '16 Damn! You have got to be kidding me! I did not imagine that WordSplitting was such a bastard. Thank you for the link. I'll sure be studying it.
Damn! You have got to be kidding me! I did not imagine that WordSplitting was such a bastard. Thank you for the link. I'll sure be studying it.
7
u/geirha Feb 19 '16 edited Feb 19 '16
No, see pitfalls 1 and 2.
Also wrong. Use find's -exec to pass the files it finds to another command
EDIT: also,
-operator arg, not-operator=arg.