quenyan
Sat May 02, 2020 9:07:37 am
I'm pretty sure I made no mistakes in making a shell script.
I tried to make a sample.sh script like this
with sudo chmod +x, this file now should be executable. it execute just fine in terminal. but when I execute it by clicking the script, the terminal open and close after 0.025 secs which is i dont know why.
I want to embed it to a key shortcut.. please help.
I want to make this script
this script is like a simple clipboard thing
=========
SOLUTION
=========
use "exit" or "read" at the end of the bash script
caution: if you are executing the script from shortcut key, do not use "./path/to/script.sh", instead use "sh /path/to/script.sh"
If you just wanted to execute it from the terminal using command "./<script_name>.sh", then you dont need the "exit" or "read" command. my feeling telling me that ubuntu designed to prevent script from running if there is no "end" contained in a script when executing it from the file manager or shortcut key
I tried to make a sample.sh script like this
- Code:
#!/bin/bash
echo -n "hello world"
with sudo chmod +x, this file now should be executable. it execute just fine in terminal. but when I execute it by clicking the script, the terminal open and close after 0.025 secs which is i dont know why.
I want to embed it to a key shortcut.. please help.
I want to make this script
- Code:
echo -n "test123" | xsel -b
this script is like a simple clipboard thing
=========
SOLUTION
=========


