# HG changeset patch # User Noah Evans # Date 1316447492 -7200 # Node ID 1302c7055fbab0f3d2f5802d380e0d71113e8326 # Parent b8d65a4850098db4f3d4cacb115e2116f3dae52c mkss: add the mkss command for quickly writing shell scripts. R=nix-dev, rminnich CC=nix-dev http://codereview.appspot.com/5063042 diff -r b8d65a485009 -r 1302c7055fba rc/bin/mkss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/rc/bin/mkss Mon Sep 19 17:51:32 2011 +0200 @@ -0,0 +1,16 @@ +#!/bin/rc + +# TODO +# take scripts from standard input +# make it possible to install scripts to rc bin instead. + +if(! ~ $#* 1){ + echo usage: $0 scriptname >[1=2] + exit usage +} + +echo '#!/bin/rc +' >$home/bin/rc/$1 +plumb $home/bin/rc/$1 + +chmod 0755 $home/bin/rc/$1 diff -r b8d65a485009 -r 1302c7055fba sys/man/1/mkss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sys/man/1/mkss Mon Sep 19 17:51:32 2011 +0200 @@ -0,0 +1,20 @@ +.TH MKSS 1 +.SH NAME +mkss \- create an executable shell script and open it in the editor. +.SH SYNOPSIS +.B mkss filename +.SH DESCRIPTION +.I Mkss +creates a shell script with the name specified by +.I filename +in $home/bin/rc/, then uses +.IR plumb (1) +to send the script to the user's editor. The script's permissions are executable. +.SH SOURCE +.B /rc/bin/mkss +.SH BUGS +It might be nice if mkss took scripts from stdin, making it possible to quickly turn a bunch of frequently used commands into a shell script. +.LP +Right now +.I mkss +is primarily used for making utility scripts. It might be useful to add installing to /rc/bin as an option as well.