Why I don’t use my drag and drop script in my bash script?

I have three files in my directory (in path only ANCII symbols) ...

  1. Dump my database in db.sql format (-rw-rw-r--)

  2. db.desktop file (-rw-rw-r--)

  3. restoredb.sh script (-rw-rw-r--)

    $ cat db.desktop

    [Desktop Entry] Encoding=UTF-8 Name=Drop Over Me Comment=Execute the script with the file dropped Exec=gnome-terminal -e "/home/sergei/migrations/restoredb.sh "%u"" Icon=utilities-terminal Type=Application

    $ cat restoredb.sh


    docker exec -i mysql5 sh -c 'exec mysql -uroot -pr00t -e "drop database my_db; create database ipdb character set UTF8 collate utf8_general_ci;"' docker exec -i mysql5 sh -c 'exec mysql -uroot -pr00t my_db' < $1

    sleep 500

... but I want run bash script via desktop file I get next error

/home/sergei/migrations/restoredb.sh: line 4: '/home/sergei/migrations/db.sql'

Why I get this error? Thank you!

Read more here: https://stackoverflow.com/questions/67935643/why-i-dont-use-my-drag-and-drop-script-in-my-bash-script

Content Attribution

This content was originally published by HtmlMan at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: