Skip to content

Instantly share code, notes, and snippets.

@shoorick
Created November 18, 2014 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shoorick/7d5f97e866ab5af498ae to your computer and use it in GitHub Desktop.
Save shoorick/7d5f97e866ab5af498ae to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
print STDERR "Press ^C to exit\n";
my $cmd_line = 'wc ' . join ' ', @ARGV;
my $out;
while (1) {
$out = `$cmd_line`;
chomp $out;
print "\cM$out";
sleep 1;
}
@shoorick
Copy link
Author

Use watch instead of this script:
watch -n 1 wc -l some.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment