I created an array that holds a students name and three grade scores:
studentArray=( [0]="John Doe":100:88:90 )
My trouble is when I run the cut command in the shell, like so
cut -d: -f1 /submit/studentGrades
It displays the whole contents of the bash script instead of just the portion I want, which is the name.
#!/bin/bash
studentArray=( [0]="John Doe"
echo "${studentArray[0]}"
exit 0
If I do field 2 instead like so:
cut -d: -f2 /submit/studentGrades
it only displays the first grade which I want, but it still displays the whole contents of the bash script.
What am I doing wrong? This is my first time working with arrays in Bash Scripting.
Thank you for your help in advance!