logoISU  

CS469/569 - Linux and Unix Administration and Networking

Spring 2022

Displaying ./code/02-03-Bash_Conditionals_and_Loops/print.sh

#!/bin/bash

if [[ -z $1 ]]; then
  echo "Usage: print.sh <path>";
  exit 1;
fi

dir="${1:?You must provide a path}";

for file in $dir/*
do
  echo "$file";
done