Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
cat > test_script_name <<EOF
#!/bin/bash/sh
echo It worked
EOF
chmod +x test_script_name
./test_script_name
#!/usr/bin/perl
use strict;
use warnings;
my %saved_env = %ENV;
my $term = $ENV{TERM};
my $error_count = 0;
foreach my $var (sort keys %saved_env) {
return (
  <div className="App">
    <h1>Quantum Pilot</h1>
      <div className="content">
        <div className="box"><About/></div>
        <div className="box">HnnYoutube</div>
        <div className="box">{buy}</div>
        <div className="box">{mykeys}</div>
      </div>

Demo program for a bug that appears under Termux on Android.

The %n format for printf does not work.

Files:

  • percent-n-test.c is the test program.
  • correct-output.txt is the correct output
  • incorrect-output.txt is the output under Termux on my Nexus 9, Android 7.1.1
@Keith-S-Thompson
Keith-S-Thompson / README.md
Last active September 21, 2016 22:54
How to use {{ }} with Markdown

I would like to write {{ ... }} inside a code block using Markdown.

For example:

{{ var }}  

I don't know why it disappears. However I can write it outside a block of code: \ {\ { var \ } \ }.

Reference: http://stackoverflow.com/q/39627452/827263

@Keith-S-Thompson
Keith-S-Thompson / README.md
Last active August 27, 2016 21:35
"Array ints not returning correctly"
@Keith-S-Thompson
Keith-S-Thompson / README.md
Last active November 9, 2015 22:50
Demonstration of Ctrl-Z bug, bash 4.4-beta

This gist contains strace output for bash 4.4-beta on Debian 6.0.10. It demonstrates a problem with the handling of Ctrl-Z (SIGTSTP).

For some unknown reason, the behavior differs depending on whether I use xterm (where it works correctly) or rxvt (where it doesn't).

The commands I used are:

xterm -e strace -o xterm_bash.strace /usr/local/bin/bash --norc

This is a CVS demo script for this question posted by Paul Bunch on Stack Overflow.

The cvs annotate command prints a message on standard error of the form:

Annotations for hello.txt
***************

The questioner is trying to redirect that message when invoking cvs annotate from a Perl script. I have so far been unable to reproduce the problem. I ask Paul Bunch to try running this script on his own system.