Skip to content

Instantly share code, notes, and snippets.

@gunnarig
Created September 9, 2018 21:12
Show Gist options
  • Save gunnarig/1330bb0673c2b8506ad1a30ec036831a to your computer and use it in GitHub Desktop.
Save gunnarig/1330bb0673c2b8506ad1a30ec036831a to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$#" -eq 0 ]
then
cd "$(dirname ${BASH_SOURCE[0]})"
ls | sort | run-parts
fi
if [ $1 ! 1 ]
then
echo Invalid number of arguments
exit
fi
if [ ! -d $1 ]
then
echo directory does not exist
exit
fi
ls $1 | sort | run-parts $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment