create shell script to open two terminal with different programs in gdb with here document

StackOverflow https://stackoverflow.com/questions/18879271

Pergunta

I want to run two terminals with follwing options.

1)

gdb drizzle

2)

gdb drizzled << EOF

If I start the script with gnome-terminal or xterm it doesn't run the commands I give it afterwards.

Foi útil?

Solução

1)

xterm -e gdb drizzle

2)

xterm -e bash -c 'gdb drizzled <<EOF
heredoc ...
EOF'

The -e option to xterm doesn't run a shell, so you need to invoke bash explicitly if you want to use shell features like here-doc.

If you want the xterm to stick around after a command executes, use:

xterm -e bash -c 'command; echo Press return to exit; read x'

Outras dicas

I think you added an extra d on your command:

gdb drizzled << EOF

Should perhaps be

gdb drizzle << EOF

Also it depends on the commands you placed after EOF.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top