linux - open a tab and running a script using gnome-terminal --tab option on Ubuntu -
i in project directory.
$ pwd /home/karthik/projects
i following cmdline.
gnome-terminal --tab --working-directory="/home/karthik/mininet" -e "sudo ./my_topo.sh"
i expect above command following
1) open tab 2) go working directory `/home/karthik/mininet` 3) execute script `my_topo.sh`
instead seems following.
1) open terminal. 2) go working directory `/home/karthik/mininet` 3) execute script `my_topo.sh`
also on related note,how open tab sudo privileges don't have type in password?
i tried doing following
wid= xprop -root | grep "_net_active_window(window)"| awk '{print $5}'; xdotool windowfocus $wid; xdotool key ctrl+shift+t $wid
this open new tab how execute following commands in new tab instead of old one.
cd /home/karthik/mininet; sudo ./my_topo.sh
try bash script:
#!/bin/sh gnome-terminal -x sudo ./home/karthik/mininet/my_topo.sh
Comments
Post a Comment