teaching machines

CS 330 Lecture 3 – Shell Scripting Cont’d

January 29, 2016 by . Filed under cs330, lectures, spring 2016.

Agenda

TODO

Note

Today we’re going to continue writing shell scripts together. On Monday, we dive into Ruby.

Code

book

#!/usr/bin/env zsh

echo $(pwd) > $HOME/.bm

koob

#!/usr/bin/env zsh

echo -n "Before: "
pwd
cd $(cat $HOME/.bm)
echo -n "After: "
pwd

forothersify

#!/usr/bin/env zsh

scp $1 twodee.org:/home2/twodeeor/www/share
ssh twodee.org "chmod o+r /home2/twodeeor/www/share/${1:t}"

top10

#!/bin/sh

du . | sort -nr | head -n10