Question: If i use 

```
ssh -Y username@hostname

```

and reach at another host and type x clock & it is working fine.But if i use it in script In online like

```
ssh -Y username@hostname x clock & ;

```

it gives me error as ksh: x clock: not found.

Please suggest.

Answer: 
First, I think that it should be `xclock` and not `x clock` (no space!). If you want to execute commands over SSH then ideally you would have something along the lines:

`ssh user@host 'ls -lrt'`
just run:

```
ssh -Y username@hostname  clock 

```

the script you're using tries to exec the command `x` which doesn't exists