Download this file

newdir.sh    23 lines (15 with data), 275 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
fatal()
{
echo $*; exit 1
}
usage()
{
fatal 'Usage: newdir nom'
}
test $# -gt 1 || usage
dir=`echo $* | sed -e 's/ /_/g' -e 's!/!_!g'`
echo dir: $dir
mkdir $dir || fatal mkdir failed
cp -i template.html $dir/index.html
open -a emacs $dir/index.html