I have to run a bash script GoogleDrive.sh
that changes the environment variables of ~/.profile
file. In terminal emulator source GoogleDrive.sh
works fine, but when I put this command in desktop shortcut it says source
is not a command and it is not recognized.
How can I run GoogleDrive.sh
file with the source
command without opening new terminal session?
The file GoogleDrive.sh
looks like this:
#!/bin/bash
if [ $GOOGLE_DRIVE_ON -eq 0 ]; then
google-drive-ocamlfuse ~/GoogleDrive
export GOOGLE_DRIVE_ON=1
dolphin ~/GoogleDrive
else
fusermount -u ~/GoogleDrive
export GOOGLE_DRIVE_ON=0
fi
The global variable in my .profile
file is GOOGLE_DRIVE_ON
.
The source
command runs fine from the terminal emulator, but from a desktop shortcut it is not recognizable.
I use Kali linux
.
~/.profile
so they're read when you log in? Or are you saying they are in your~/.profile
but they are not used by your graphical shell? What operating system are you using? If Linux with a GUI, which Linux, which desktop manager and which login manager are you using? Also what is a "shortcut"? Do you mean a.desktop
file? – terdon♦ Jul 15 '20 at 11:57