-
Notifications
You must be signed in to change notification settings - Fork 5
/
RunInTerminalOpt
executable file
·44 lines (39 loc) · 1.17 KB
/
RunInTerminalOpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Run a command in terminal.
# See also: RunInTerminal
#
# This one supports these options:
# - Give a prompt for the user
# --prompt <prompt-string>
# - Give terminal options
# --term <terminal-options-string>
# - Don't require user to press ENTER key to close the terminal window
# --no-enter-wait
# - Stop parsing more parameters
# --
#
# Examples:
# - Simple command
# RunInTerminalOpt pwd
# - If command has options, use -- to stop parsing
# RunInTerminalOpt -- ls -la
# - Run multiple commands
# RunInTerminalOpt -- bash -c "pwd ; ls -la"
# - If file name has spaces, use baskslash (\) to quote space
# RunInTerminalOpt -- bash -c "pwd ; ls -la foo\ bar" # needs file "foo bar" to exist!
# - Use an option
# RunInTerminalOpt --prompt="Here you are:" -- bash -c "pwd ; ls -la"
# - Redirection
# RunInTerminalOpt -E "echo '$(date)' > /tmp/foobar"
source /usr/share/endeavouros/scripts/eos-script-lib-yad || {
echo "Error: cannot source eos-script-lib-yad" >&2
exit 1
}
export -f eos_yad_terminal
export -f eos_yad_RunCmdTermBashOpt
export -f eos_yad
Main()
{
eos_yad_RunCmdTermBashOpt "$@"
}
Main "$@"