I'm having trouble taking in a path where to run the script as a command line argument, test is it exists, then changing to that path to perform work. Here what I'm trying:
#!/bin/bash scriptpath=$1 if [ $# -lt 1 ] then echo "Usage: script.sh <directory_name>" fi if [ -d scriptpath ] then # work...... else echo "Directory does not exist" fi