If you're a unix user you may be familiar with the popular command 'ls'. The 'ls' command simply prints all the files and folders in a directory. Today's objective is to create a program that takes in an absolute folder path and prints out all the files and folders inside that directory. For bonus points make it also work with relative paths. If an invalid directory is passed simply print out "Invalid directory".
Comments:
Anonymous - 9 years, 1 month ago
#!/bin/bash [[ ! -d "$1" ]] && echo 'Invalid Directory' && exit 1 ls -1 "$1"
reply permalink
Anonymous - 9 years, 1 month ago
reply permalink
Driphter - 9 years, 1 month ago
Clojure!
reply permalink