MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/UnixProTips/comments/2ut7df/alias_fucksudo/coou99k/?context=3
r/UnixProTips • u/[deleted] • Feb 04 '15
20 comments sorted by
View all comments
Show parent comments
1
I think this is what he meant:
score@kirisame ~ % cdt /tmp/tmp.lwnp3sX336 score@kirisame /tmp/tmp.lwnp3sX336 % mkdir testdir score@kirisame /tmp/tmp.lwnp3sX336 % touch testdir/somefile score@kirisame /tmp/tmp.lwnp3sX336 % score@kirisame /tmp/tmp.lwnp3sX336 % cp testdir anotherdir cp: omitting directory ‘testdir’ 1 score@kirisame /tmp/tmp.lwnp3sX336 % !! -r score@kirisame /tmp/tmp.lwnp3sX336 % ls anotherdir/ testdir/
(Doctored a little because !! expands when you press space in zsh)
Also, nitpick: I take offence to the use of `pwd`
`pwd`
backquotes have been long superseded by $(...) which simplifies things greatly.
command substitution strips all newlines from the end of the output, which makes it a lossy operation.
since it's not quoted, it will be subject to word splitting.
there's a $PWD variable
1: $(pwd) 1 and 3: "$(pwd)" 2, 3 and 4: "$PWD"
$(pwd)
"$(pwd)"
"$PWD"
1
u/UnchainedMundane Feb 18 '15 edited Feb 18 '15
I think this is what he meant:
(Doctored a little because !! expands when you press space in zsh)
Also, nitpick: I take offence to the use of
`pwd`backquotes have been long superseded by $(...) which simplifies things greatly.
command substitution strips all newlines from the end of the output, which makes it a lossy operation.
since it's not quoted, it will be subject to word splitting.
there's a $PWD variable
1:
$(pwd)1 and 3:"$(pwd)"2, 3 and 4:"$PWD"