Skip to main content
Corrected grammar and meaning of ^S (it's XOFF, not XON, d'Oh!); added emacs-specific procedure; added assumption regarding comment by [MD XF].
Source Link

C, 29 bytes (Emacs) / 40 bytes (VI)

Before creating program, doexecute the shell command

stty -ixon      ### 11 bytes, with the newline

N.B this is required for most terminal editors, but is not required for emacs

then write this code:

main(){printf("%d",'j'*'^S');}

N.B. '^S' is a single XONXOFF character e.g. in VI use control-V, control-SS; in emacs use control-Q, control-S; emacs turns off flow control by default.

I assume the comment [You can't type ^S in a Linux terminal] below left off an implied [without the stty command or equivalent e.g. emacs default behavior upon startup], otherwise that comment is inaccurate.

And here is the requested hexdump:

$ od -a -t x1 x.c
0000000   m   a   i   n   (   )   {   p   r   i   n   t   f   (   "   %
         6d  61  69  6e  28  29  7b  70  72  69  6e  74  66  28  22  25
0000020   d   "   ,   '   j   '   *   ' dc3   '   )   ;   }  nl
         64  22  2c  27  6a  27  2a  27  13  27  29  3b  7d  0a

C, 29 bytes

Before creating program, do shell command

stty -ixon

then write this code:

main(){printf("%d",'j'*'^S');}

N.B. '^S' is a single XON character e.g. in VI use control-V, control-S.

C, 29 bytes (Emacs) / 40 bytes (VI)

Before creating program, execute the shell command

stty -ixon      ### 11 bytes, with the newline

N.B this is required for most terminal editors, but is not required for emacs

then write this code:

main(){printf("%d",'j'*'^S');}

N.B. '^S' is a single XOFF character e.g. in VI use control-V, control-S; in emacs use control-Q, control-S; emacs turns off flow control by default.

I assume the comment [You can't type ^S in a Linux terminal] below left off an implied [without the stty command or equivalent e.g. emacs default behavior upon startup], otherwise that comment is inaccurate.

And here is the requested hexdump:

$ od -a -t x1 x.c
0000000   m   a   i   n   (   )   {   p   r   i   n   t   f   (   "   %
         6d  61  69  6e  28  29  7b  70  72  69  6e  74  66  28  22  25
0000020   d   "   ,   '   j   '   *   ' dc3   '   )   ;   }  nl
         64  22  2c  27  6a  27  2a  27  13  27  29  3b  7d  0a

C 29 characters

C, 29 bytes

Before creating program, do shell command

stty -ixon

then write this code:

main(){printf("%d",'j'*'^S');}

N.B. '^S' is a single XON character e.g. in VI use control-V, control-S.

C 29 characters

Before creating program, do shell command

stty -ixon

then write this code:

main(){printf("%d",'j'*'^S');}

N.B. '^S' is a single XON character e.g. in VI use control-V, control-S.

C, 29 bytes

Before creating program, do shell command

stty -ixon

then write this code:

main(){printf("%d",'j'*'^S');}

N.B. '^S' is a single XON character e.g. in VI use control-V, control-S.

Source Link

C 29 characters

Before creating program, do shell command

stty -ixon

then write this code:

main(){printf("%d",'j'*'^S');}

N.B. '^S' is a single XON character e.g. in VI use control-V, control-S.