I'm trying to create a Nemo script that will calculate total file size of selected files and pass it on to the rest of the script.
It is using NEMO_SCRIPT_SELECTED_FILE_PATHS environment variable that Nemo itself sets when some files are selected.
The problem is, the variable contains a new line separeted paths and file names and I don't know how to handle those.
Any ideas?
Edit: what I get if I echo the contents of the variable into a file is eg:
/home/sasa/Pictures/1041247.png /home/sasa/Pictures/849611447.jpg /home/sasa/Pictures/IO2.jpg
which looks more like space than new line delimited.
You can use
du
:This will not work when the file names contain spaces.
Use this: