Skip to content

Instantly share code, notes, and snippets.

condition=1
case "$1" in
1|2)
echo "common to 1 and 2"
if [[ $condition ]]; then
echo "condition met"
fi
;;
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
#!/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";
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
my @a = (1..3);
say @a;
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 $delim = ":";
my $field = 4;
my $grep_string = "something";
<?php
if (osse.cute == true) {
// if (osse.bugger == true) {
print ":)";
}
?>
$datetext{string} = strftime "%Y-%B-%d (%A)", localtime;
sub isDateAlreadyWritten {
my $ret = 0;
my $bw = File::ReadBackwards->new($log_file);
until ($bw->eof) {
my $line = $bw->readline;
chomp($line);
sjohnson@web1:/tmp/sjohnson$ cat osse.txt
sjohnson osse
a b
sjohnson@web1:/tmp/sjohnson$ for i in {0..5} ; do cat osse.txt | tab --spaces=$i ; done
sjohnsonosse
a b
sjohnson osse
a b
sjohnson osse
a b
sjohnson@web1:~$ history | tail
1207 mb rpkergp regperk geropkgrepkgo
1208 mb B4E-1351716775-0.xls B4E-small.xls
1209 echo $PS1 | md5sum
1210 history
1211 stuff
1212 blah
1213 cheese
1214 history | tail | hd
1215 vi