#!/bin/bash function usage { printf "./$(basename $0) -h - - shows help \n" printf "./$(basename $0) -i input_dir -o output_dir - - convert wav in real time into wav in time expansion x10 \n" } optstring=":hi:o:" # Defaults indir="raw" outdir="exp" while getopts ${optstring} arg do case "${arg}" in h) printf "$(basename $0) usage: \n" usage ;; i) indir="${OPTARG}" echo "indir: $indir" ;; o) outdir="${OPTARG}" echo "outdir: $outdir" ;; :) echo "$0: Must supply an argument to -$OPTARG." exit 1 ;; ?) echo "Invalid option: -${OPTARG}." echo usage ;; esac done splitdir=$(sed "s/raw/split/g" <<< $indir) bash split_5s.sh -i $indir -o $splitdir exit 0