I have been trying many different ways to loop through the arguments, using different ways with for and while loops, yet it doesn't work. My script should take arguments and answer if they are files, directoies etc.
while $1 in "$@" ;do
if [ -f $1 ];then
echo "$1 regular file"
elif [ -d $1 ];then
echo "$1 directory"
elif [ -f $1 ];then
echo "$1 excuteable file"
elif [ -h $1 ];then
echo "$1 symbolic"
else
echo "$1 Does not exist"
fi
1=$(( $1 + 1 ))
done
How do I loop though each arguments?