View Single Post
 
Old Oct 08, 2017, 07:34 PM
IchbinkeinTeufel's Avatar
IchbinkeinTeufel IchbinkeinTeufel is offline
Elder
Community Liaison
 
Member Since: Jan 2010
Location: Earth
Posts: 6,270
One of my favorite past times is to make utterly, embarrassingly redundant and obnoxious code to achieve something stupidly simple, like echo the number 1. Yes, all this will in-fact echo the number 1. lol

while read -r; do echo "$REPLY"; done <<< "$(B=('WHUT(){ (echo $(A=1; echo "$(( ${A/1/1} - 1 + 1 ))" | tr "1" "1")); }; WHUT'); [ 1 -eq 1 ] && { { eval "${B[@]}"; }; })"

Like that. xD Good on you if you can make sense of it; I don't fancy explaining it. lol (using bash, by the way)

Or something like this, which just echos "cow":

WHUT(){ ANIMAL=$( if [ cow == cow ]; then echo cow; else printf "%s\n" "cow"; fi; ); for THING in $ANIMAL; { echo "$THING"; }; }; WHUT

Here's a shorter one which says "Hello, everyone."

B=($(A=(Hello, everyone.); echo "${A[0]} ${A[1]}")); echo "${B[@]}"

That one I can be bothered to explain (hah):

B sets a variable array. Inside that array is another array with command substitution which evaluates to the echoing of two words "Hello," and "everyone."; those words pointlessly individually echoed by variable index, because why not? lol After that, the entire mess is then echod once more, this time echoing the entire array B which contains the now expanded string.

Then there's awk, although I'm not as good with that, but this obnoxious mess will echo 1:

awk 'THING{B=2; C=3; if(B<C && C>B) X=2}; BEGIN{A=X--; printf("%d\n",length(A)); for(I=1;I!=1;I=1) print I; exit}'

You get the idea. xD
__________________
{ Kein Teufel }
Translation: Not a devil
[ `id -u` -eq 0 ] || exit 1

Last edited by IchbinkeinTeufel; Oct 08, 2017 at 08:14 PM.
Thanks for this!
bearguardian