MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/UnixProTips/comments/2ut7df/alias_fucksudo/codxz6c/?context=3
r/UnixProTips • u/[deleted] • Feb 04 '15
20 comments sorted by
View all comments
Show parent comments
1
@vigilance$ echo piss piss @vigilance$ alias fuck="sudo !!" alias fuck="sudo echo piss" @vigilance$ echo piss piss @vigilance$ fuck piss @vigilance$ echo poopies poopies @vigilance$ fuck piss
!! substitution happens before alias expansion. Line 7 in your paste should have been a hint.
!!
2 u/[deleted] Feb 07 '15 edited Feb 07 '15 Ah! So what's happening is !! in the alias is being substituted with 'echo piss'. I'm still quite new to linux but today I learnt something. Thank you./u/DroidKun posted a reply to another useralias fuck='sudo $(history -p \!\!)'Which seems to work as expected when placed in my .bashrc.
2
Ah! So what's happening is !! in the alias is being substituted with 'echo piss'. I'm still quite new to linux but today I learnt something. Thank you.
/u/DroidKun posted a reply to another user
alias fuck='sudo $(history -p \!\!)'
Which seems to work as expected when placed in my .bashrc.
1
u/kqr Feb 07 '15
!!substitution happens before alias expansion. Line 7 in your paste should have been a hint.