summaryrefslogtreecommitdiffstats
path: root/bin/viod
diff options
context:
space:
mode:
Diffstat (limited to 'bin/viod')
-rwxr-xr-xbin/viod17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/viod b/bin/viod
new file mode 100755
index 0000000..8bb4c21
--- /dev/null
+++ b/bin/viod
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+editor=vi
+
+if [ $# -eq 0 ]
+then
+ echo "usage: `basename $0` file"
+ exit 1
+fi
+
+file=$1
+
+timestamp=`stat -c %y "$file" | cut -d. -f1 | cut -d" " -f1 | awk -F- '{print $1 $2 $3}'``stat -c %y "$file" | cut -d. -f1 | cut -d" " -f2 | awk -F: '{print $1 $2 "." $3}'`
+
+"$editor" "$file"
+
+touch -t $timestamp "$file"