Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
my $delim = ":";
my $field = 4;
my $grep_string = "something";
man ()
{
if /usr/bin/man "$@" > /dev/null 2>&1; then
/usr/bin/man "$@" | vi - -R;
else
/usr/bin/man "$@";
fi
}
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
my @a = (1..3);
say @a;
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
my $file_input = $ARGV[0];
open my $fh_read, '<', $file_input or die "can't open input file for reading";
sjohnson@web1:/tmp/sjohnson$ rar a osse.zip pig.bash
RAR 3.90 beta 2 Copyright (c) 1993-2009 Alexander Roshal 3 Jun 2009
Shareware version Type RAR -? for help
Evaluation copy. Please register.
Creating archive osse.zip
Adding pig.bash OK
condition=1
case "$1" in
1|2)
echo "common to 1 and 2"
if [[ $condition ]]; then
echo "condition met"
fi
;;
# new and improved!
#
# N.B.: how I felt about legacy tar syntax: http://i.imgur.com/fsZI0.jpg
tar () {
local main_arg="$1"
if [ "${main_arg:0:1}" != "-" ] ; then
main_arg="-$main_arg"
fi
func! FixShiftGlobal()
if getcmdtype() == ":"
let gcp = getcmdpos()-1
let head = strpart(getcmdline(), 0, gcp)
if head ==# "G" || head ==# "'<,'>G" || head =~# '^\.,\.+\d\+G$'
return "\<BS>g/"
endif
endif
return '/'
endfunc
sjohnson@web1:~/bin$ url_deparse
feature enabled: decryption
feature enabled: colour plaintext
http://smu/bogus/?q=h.cart.ecart&t=3&dm=2&a=view&g=supp,grp,&l[supp]=TBM&l[grp]=E&supp=TBM&grp=E&boid=330519&u=102246
parse_url results:
Array
(
Test Summary Report
-------------------
t/gif.t (Wstat: 0 Tests: 1 Failed: 1)
Failed test: 1
Parse errors: Bad plan. You planned 0 tests but ran 1.
t/png.t (Wstat: 0 Tests: 2 Failed: 1)
Failed test: 2
Files=3, Tests=5, 0 wallclock secs ( 0.03 usr + 0.05 sys = 0.08 CPU)
Result: FAIL
Failed 2/3 test programs. 2/5 subtests failed.