So I am writing a script that will interpret the partition table of a forensic evidence file, find the unallocated spaces, then determine if those spaces are empty or contain data.
I am stuck on the first command. *facepalm*
The command is mmls. When I run mmls <image> in BASH, no problem. When I run mmls in the script (even with nothing else), I get a segmentation fault (with a 4k or 5k number). This occurs whether I use $1 or $image as an argument for mmls.
What if you just put the one line "mmls image_to_use" in the shell script (even leave out #! line). In other words, try the simplest case, see if that works, add in other details, find out the mistake.
I needed to have "$image" in quotes. It turns out that when I used \ to escape the white space, the parent process chewed through that leaving the space unescaped by the time it was passed to the child process. Hope that makes sense.