I select 4 files in Nemo in the path /home/myUsername/.local/share/nemo/scripts/Folder with spaces/
. Nemo stores the file paths in the environment variable NEMO_SCRIPT_SELECTED_FILE_PATHS
.
(As you can see in the answer from glenn jackman
below, NEMO_SCRIPT_SELECTED_FILE_PATHS
contains a newline-separated list of file paths.)
Why is "Yeah!" not printed after every file path line? How can I achieve that? (This question is maybe irritating, because I initially thought this list of file paths is an array, which it is obviously not.)
SCRIPT
#!/bin/bash
for i in "${NEMO_SCRIPT_SELECTED_FILE_PATHS[@]}"
do
echo "$i"
echo "Yeah!"
done
OUTPUT
/home/myUsername/.local/share/nemo/scripts/Folder with spaces/script1
/home/myUsername/.local/share/nemo/scripts/Folder with spaces/script2
/home/myUsername/.local/share/nemo/scripts/Folder with spaces/script3
/home/myUsername/.local/share/nemo/scripts/Folder with spaces/script4
Yeah!
echo "${#NEMO_SCRIPT_SELECTED_FILE_PATHS[@]}"
to see how many elements are in the array. Please show how you populate that array.