Reputation: 97
I am using centos Linux. I wanted to open a new tab in the current window terminal from a script file named 'myscript'. I use the following script
#!/bin/bash
WID=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)"| awk '{print $5}')
xdotool windowfocus $WID # line 5
xdotool key ctrl+shift+t #line 6
wmctrl -i -a $WID # line 7
referred from this link Open a new tab in gnome-terminal using command line. I run the script in this way source myscript
and i get an error saying Illegal variable name
. How to fix this ?
Note! I don't want to open new tabs in a new window.
Upvotes: 0
Views: 2877
Reputation: 200
The problem is the $(commands) statement. Try to use `` instead:
set WID=`xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)"| awk '{print $5}'`
xdotool windowfocus $WID
xdotool key ctrl+shift+t
wmctrl -i -a $WID
Upvotes: 1