I am new to Linux - trying to run a set of commands using a shell script. The commands are from the Neper software package but I am pretty certain the issue is with permissions of my shell script. When I enter the commands line-by-line in the terminal I get the correct output but when I run the shell script, files are not generated correctly.
Here is the shell script:
#!/bin/bash
neper -T -n 500 -domain "cube(1,1,0.5)" -morpho gg -morphooptistop eps=1e-2 -statseed x,y,z,w -o part1
awk '{print $1,$2,$3}' part1.stseed > part1.coo
awk '{print $4}' part1.stseed > part1.w
neper -T -n 100 -dim 2 -morpho gg -morphooptistop eps=1e-2 -statseed x,y,z,w -o part2
awk '{print $1,$2,0.6}' part2.stseed > part2.coo
awk '{print $4}' part2.stseed > part2.w
cat part1.coo part2.coo > coo
cat part1.w part2.w > w
neper -T -n 600 -morphooptiini "coo:file(coo),weight:file(w)" -o full
neper -V full.tess -print img
Output: Using the shell script, the part1 and part2 .stseed files are generated as extensionless files (0 kb). This then generates the error:
awk: fatal: cannot open file 'X.stseed' for reading: No such file or directory.
Later on, the .coo and .w files are generated as .coo· and .w· files. Because of the added interpunct - the files are not recognized by latter code and again, the No such file or directory error shows up.
Any idea of what I am doing incorrectly is appreciated. I am running the shell scripts using chmod and have tried various modes and options.