简体   繁体   中英

Error while running xterm in telnet script

This is error while running the telnet script. Language: Shell script

Error:

Type xterm -help for a full description.

xterm: Explicit shell already was /root/Desktop/stage2/./close_telnet.sh
xterm: bad command line option "192.168.0.1 25"

usage:  xterm [-/+132] [-C] [-Sccn] [-T string] [-/+ah] [-/+ai] [-/+aw]
    [-b number] [-/+bc] [-bcf milliseconds] [-bcn milliseconds] [-bd color]
    [-/+bdc] [-bg color] [-bw number] [-/+cb] [-cc classrange] [-/+cjk_width]
    [-class string] [-/+cm] [-/+cn] [-cr color] [-/+cu] [-/+dc]
    [-display displayname] [-e command args ...] [-fa pattern] [-fb fontname]
    [-/+fbb] [-/+fbx] [-fd pattern] [-fg color] [-fi fontname] [-fn fontname]
    [-fs size] [-/+fullscreen] [-fw fontname] [-fwb fontname] [-fx fontname]
    [%geom] [#geom] [-geometry geom] [-help] [-/+hm] [-/+hold] [-iconic]
    [-/+ie] [-/+im] [-into windowId] [-/+j] [-/+k8] [-kt keyboardtype] [-/+l]
    [-/+lc] [-lcc path] [-leftbar] [-lf filename] [-/+ls] [-/+maximized]
    [-/+mb] [-mc milliseconds] [-/+mesg] [-/+mk_width] [-ms color] [-n string]
    [-name string] [-nb number] [-/+nul] [-/+pc] [-/+pob] [-report-colors]
    [-report-fonts] [-rightbar] [-/+rv] [-/+rvc] [-/+rw] [-/+s] [-/+samename]
    [-/+sb] [-selbg color] [-selfg color] [-/+sf] [-sh number] [-/+si] [-/+sk]
    [-sl number] [-/+sm] [-/+sp] [-/+t] [-ti termid] [-title string]
    [-tm string] [-tn name] [-/+u8] [-/+uc] [-/+ulc] [-/+ulit] [-/+ut] [-/+vb]
    [-version] [-/+wc] [-/+wf] [-xrm resourcestring] [-ziconbeep percent]

Type xterm -help for a full desc

Please suggest any idea to solve this error.

The likely problem is that $window_id is an empty value. That would produce the error message from xterm.

In a quick check, I have the output from wmctrl -lp as

$ wmctrl -lp                                                                    
0x00400023  0 1036         localhost.localdomain [!./bar] - vile           
0x00a0000a  0 3981   localhost.localdomain xclock xclock

but the output of the expression with xprop is 0x0400023 (a different number of leading zeros).

If I change the fragment

awk '{print $5}' | sed 's/,//' | sed 's/^0x/0x0/'

to

awk '{sub(",","",$5);printf("%#010x",$5);}'

it gives a usable result (for my machine: ymmv ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM