diff --git a/, b/, index 6fbe681..c08e5aa 100755 --- a/, +++ b/, @@ -1,16 +1,16 @@ -#!/usr/bin/env ruby +#!/bin/bash +set -e -puts %q[This is a "comma script", meaning a script starts with a comma. -The benefit is: type "," and press TAB, and you can see all comma scripts! -] +echo "This is a \"comma script\", meaning a script starts with a comma." +echo "The benefit is: type \",\" and press TAB, and you can see all comma scripts!" -puts '' +echo "" -puts 'Shell: ' + `echo $SHELL` -puts "PATH: #{ENV['PATH'].split(':').size} paths [Please run ',path' to view path list]" +echo "Shell:" $(echo $SHELL) +echo "PATH:" $(echo "$PATH" | tr ':' '\n' | wc -l) "paths [Please run ',path' to view path list]" -puts '' +echo "" -puts 'Ruby version: ' + `/usr/bin/env ruby -v` -puts 'Python version: ' + `/usr/bin/env python --version` +echo "Ruby version:" $(/usr/bin/env ruby -v) +echo "Python version:" $(/usr/bin/env python --version) diff --git a/,week b/,week new file mode 100755 index 0000000..e9510d2 --- /dev/null +++ b/,week @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + +require 'date' + +idx = ARGV[0] || '0' +idx = idx.to_i + + +today = Date.today + idx*7 + +monday = today - today.cwday + 1 +sunday = monday + 6 + +puts "week-#{today.cweek}-#{monday.strftime('%m%d')}-#{sunday.strftime('%m%d')}"