Reputation: 2695
What I want to achieve is as the following:
exec screen
startx &
But I want to automate the above procedure in a script(in fact to put it in my ~/.bashrc). What's the simple and elegant way to do it?
The closest shot I got is like this:
exec screen bash -c "startx; bash"
but this way startx cannot get into background. That is,
exec screen bash -c "startx &; bash"
won't work.
Also, I ran into this thread when googling. But
exec screen bash -i << EOF
startx &
exec < /dev/tty
EOF
don't work either. I also tried
exec screen bash -i --rcfile /tmp/somefile
with startx &
in /tmp/somefile. Again not working.
Any ideas?
Upvotes: 0
Views: 699
Reputation: 530960
Both &
and ;
are command terminators; you can only use one or the other.
exec screen bash -c "startx & bash"
Upvotes: 1