Having an odd time with a bit of code. I'm sure it's a simple fix but am unsure what that is.
#!/bin/bash
read -p 'Enter file name: ' fileName
exe=${fileName: 0: -2}
gcc $fileName -o $exe
chmod a+x $exe
./$exe
I found out it is not working at the second line but when I run it on it's works fine and as expect. I suspect its an issue with running a script within a script but am not sure how I might fix it