I'm trying to add a context menu option to Nautilus so that when I right click on a file, I can choose to run srm to securely overwrite it with zeros instead of moving it to /Trash or rm'ing it. I have the following executable in ~/.local/share/nautilus/scripts
#!/bin/bash
#Make local Nautilus filepath variable global
export srmthis=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
#Copy the above variable to a log
echo "$srmthis" >> logfile.txt
#Now, please srm secure-delete the file indicated in the filepath
sudo -E /usr/bin/srm -flz "$srmthis"
$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS is a variable set by Nautilus when a file is selected within it. My thinking is that I'd grab that into my own variable $srmthis and then pass it to srm as its target file with options "-flz" for a faster, albeit more insecure wipe.
But it doesn't work. No output, no popup warning.
When I echo "$filetosrm" >> somefile.txt
I do get an output so I know the variable is set. I can also use srm by itself in the terminal no problem.
What am I doing wrong?
Many thanks!
P.S. Tried running srm with gksu, pkexec, | xargs, etc to no avail.