question for "echo"

what is the mean: echo -n "^[]0;!*^G"
thanks

Not all shells support the -n option with echo. Under bash a -n echos content without adding a newline. For instance:

bash-2.03$ echo -n hello
hellobash-2.03$
bash-2.03$ echo hello
hello

As for the content of the echo, I'm not sure. What context did you find the command in?

Cheers,

Keith

That'll set the title of an xterm (or other compliant) terminal window when used in a graphical environment.

I use a similar echo in a script to do this.

If you typed, for example
echo -n "[2]0;Look ma^G"
Then the title would be "Look ma".

Remember that ^[ is produced by typing Ctrl-V Esc
^G is Ctrl-V Ctrl-G

Cheers
ZB


  1. ↩︎

  2. ↩︎

thanks very much, but i cant understand it clearly. Can you explain the detail of the parameters. like "Control+v" "[]"......etc.
thanks very much.