#!/bin/sh _cam_directory='cams' mkdir -p "$_cam_directory" echo '#!/bin/sh' >> "$_cam_directory/$1" # FIXME fails when run from parent directory (see mars for poss solution) echo '"$(pwd)"'"/cams/launcher.sh \"$2\" "'"$1"' >> "$_cam_directory/$1" chmod +x "$_cam_directory/$1"