Skip to content

Commit

Permalink
minor script bugfixes and tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dbushong committed Jun 24, 2015
1 parent 9e961ad commit 7834fb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions bin-shared/mv-by-date
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ usage: $prog [-E] [-n | -v] [-f] [-l | -L | -c] [-d strftime-fmt] \\
EOF
$opt{v} = 1 if $opt{n};
$opt{d} = $def_fmt unless exists $opt{d};
if ($opt{l}//0 + $opt{L}//0 + $opt{c}//0 > 1) {
if (($opt{l}//0) + ($opt{L}//0) + ($opt{c}//0) > 1) {
die "$prog: specify at most one of -l, -L, or -c\n";
}

Expand Down Expand Up @@ -106,11 +106,12 @@ sub mv_file {
return;
}

print "$file -> $path\n" if $opt{v};
my $dpath = dirname($path);
print "$file -> $dpath\n" if $opt{v};

return if $opt{n};

mkpath(dirname($path));
mkpath($dpath);
if ($opt{c}) {
copy($file, $path) || warn $!;
}
Expand Down
3 changes: 2 additions & 1 deletion bin-shared/viencsh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ else
fi

HEADER=$(cat <<EOS
#!/bin/sh
#!/bin/bash -e
set -o pipefail
base64-decode <<EOF | openssl enc -d -bf-cbc | sh #START
EOS
Expand Down

0 comments on commit 7834fb8

Please sign in to comment.