I need to work with different files in the script. The easy and convenient way to do it is to use "Drag and drop". But.
Drag and drop files to a bash script causes "Permission denied" when you output data to a file.
I use git-bash on Windows 10.
#!/bin/bash
echo "123" > out123.txt
sleep 5
When I run script in common way (I double click on it) it works well.
When I drag and drop a file (from the same folder) on the script:
#bash: out123.txt: Permission denied
Upd: It's for people who came from google:
How to get dropped data within bash script.
It's usual argument. Code example [1] or [2]:
for var in "$@"
do
echo "$var"
done