Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A script in a script 2

Status
Not open for further replies.

operadornine

IS-IT--Management
Jul 19, 2010
51
AR
Hi all,

I have this script

/etc/init.d/ssh start
startx
sleep 10
./xrandr.sh

the ./xrandr.sh calls this command (xrandr -s 1280x768)

but the script always get only to the startx. i cant make it execute the ./xrandr.sh

THanks all
 
./ means to run the script in the current working directory. I can only assume that when your script runs it is using another directory... try putting the /full/path/to/xrandr.sh instead.

Annihilannic
[small]tgmlify - code syntax highlighting for your tek-tips posts[/small]
 
yes the script are in the same directory, i tried with the hold path and nothing.

Regards
 
xrandr.sh is executable by the user trying to run it isn't it? You could try cding to the directory within the script and running it with the original ./ method. Is your DISPLAY set?

The internet - allowing those who don't know what they're talking about to have their say.
 
ken,

Please can you explain me more how to do it?

Thanks
 
operadornine,
what does your ~/.xinitrc file look like? Do you start a any X-application there in foreground? If so your script will wait for that application to finish until the rest of your script is executed. Execute startx in the background to avoid this behavior.
Code:
/etc/init.d/ssh start
startx [COLOR=red]&[/color]
sleep 10
[COLOR=red]/full/path/to[/color]/xrandr.sh
 
Well spotted stefan, totally overlooked that one!

Annihilannic
[small]tgmlify - code syntax highlighting for your tek-tips posts[/small]
 
Me too. Have another star!

The internet - allowing those who don't know what they're talking about to have their say.
 
the xrander.sh is

xrandr -s 1280x768

thanks and sorry for the delay
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top