Code has errors & No automations using Volatility

i have a small project to do in shell script
the instruction are:
Create a script that analyzes HDD and memory files.


  1. Getting the user input
    The user enters mem or hdd, and for the second argument, the filename to

  2. Function for each filetype
    The script runs operations depending on the type of file (HDD/mem).
    Available tools: binwalk, foremost, strings, bulk_extractor, volatility

  3. Save results into a file
    The file analysis should be saved in the created directory; once finished the file
    operation, display the user with the analysis statistics

the script is approximately 70 lines

i already Wrote a script
i sent it to my teacher and he told that i have 2 problems

  1. Your code has errors.
  2. No automations using Volatility.

please if somone can help write a new script or fix mine I will be grateful

link to my project:
(fileanalyzer/ at main · MJ8523/fileanalyzer · GitHub)

In your MEM function, you have the following line:

cd /home/kali/volatility_2.6_lin64_standalone

This would only work if a user has this exact home path, otherwise this will produce an error.

That is interesting you can not use Volatility but the instructions state:

Available tools: binwalk, foremost, strings, bulk_extractor, volatility

i tried to run this but there is an error when i write “mem” in function START
that should call to the MEM function instead it print an error line 24: MEM: command not found

Try moving the function declarations of MEM and HDD to be above the function declaration of START. Also, why I are you executing START twice (line 36 and line 68) in your script? I think if you just remove the first call to START, the script should find MEM and HDD without any trouble.