Recently I made a bash executable file with permissions 722 as I am almost perpetually root. The contents of the file are as follows:
#!/home/nolan/Documents/test/listFiles [ $# -lt 1 ] && dirFocus = "" || dirFocus = $1 dirSize=$(ls -a $dirFocus | wc -w) for ((a = 1; a <= $dirSize; a++)) ; do i = 1 for ITEM in $(ls -a $dirFocus); do declare -i i declare -i a if [ $a -eq $i ]; then echo "$a : $ITEM" fi i = $[ $i + 1 ] done done
When run in terminal using:
root @ /home/nolan/Documents/test: bash listFiles 1 : . 2 : .. 3 : apple 4 : dirCheck 5 : ifTest 6 : ifTest.txt 7 : listFiles 8 : myscript 9 : nolan.txt 10 : pointer_to_apple 11 : scriptx.sh 12 : Stuff 13 : weekend 14 : weekend2 15 : weekend3
I receive this outcome as expected. However the second I do:
root @ /home/nolan/Documents/test: ./listFiles bash: ./listFiles: /home/nolan/Documents/test/listFiles: bad interpreter: Too many levels of symbolic links
Is the error I get. What exactly is going wrong? I've checked other forums but they don't seem to pertain to my situation.