Skip to main content
added 196 characters in body
Source Link
gogators
  • 297
  • 1
  • 5

As a perl one-liner you could write:

perl -le 'for ($_=-1-2,$i = 0; $i<7; $i++) {$_+= $i*$i }; print'

or without a zero:

perl -le 'print ((7+1)x2)'

or without a zero OR a two in the bash shell:

x=$((7+1)) && echo $x$x

or without a zero, one, or two in bash:

false || x=$((7+$?)) && echo $x$x

or without any numbers at all:

false || x=$(($?+$?+$?+$?+$?+$?+$?+$?)) && echo $x$x

As a perl one-liner you could write:

perl -le 'for ($_=-1-2,$i = 0; $i<7; $i++) {$_+= $i*$i }; print'

or without a zero:

perl -le 'print ((7+1)x2)'

or without a zero OR a two in the bash shell:

x=$((7+1)) && echo $x$x

As a perl one-liner you could write:

perl -le 'for ($_=-1-2,$i = 0; $i<7; $i++) {$_+= $i*$i }; print'

or without a zero:

perl -le 'print ((7+1)x2)'

or without a zero OR a two in the bash shell:

x=$((7+1)) && echo $x$x

or without a zero, one, or two in bash:

false || x=$((7+$?)) && echo $x$x

or without any numbers at all:

false || x=$(($?+$?+$?+$?+$?+$?+$?+$?)) && echo $x$x

Source Link
gogators
  • 297
  • 1
  • 5

As a perl one-liner you could write:

perl -le 'for ($_=-1-2,$i = 0; $i<7; $i++) {$_+= $i*$i }; print'

or without a zero:

perl -le 'print ((7+1)x2)'

or without a zero OR a two in the bash shell:

x=$((7+1)) && echo $x$x