LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-13-2008, 07:51 AM   #1
Dutch2005NL
LQ Newbie
 
Registered: Nov 2008
Location: The Netherlands
Distribution: Ubuntu
Posts: 7

Rep: Reputation: 0
Autostart Rdesktop through batch with loop


OK i am relative new to linux so i decided to install ubuntu, wich works great, here at work we use thinstation/thinclients, in windows i would make a .bat file, state

Code:
@echo off
START /w rdesktop -f -z sbc
START /w rdesktop.bat
Wich basically makes sure that IF rdesktop is closed, the batch file just makes sure rdesktop is reopened /w corect parameters..

Now the trick is.... how to do so in linux...

i suppose a .bat wont work?

i think its going to be a bash/bin? kind of script?
 
Old 11-13-2008, 07:58 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
while [ 1 ]; do rdesktop -a -b -c -d; done

your recursion is pretty horrible. every time you run it round you spawn another depth of recursion. if you close remote desktop 20 times you have 20 instances of the batch file running, each one waiting on it's spawned clone. yuck. in batch just use a label and a goto statement instead.

Last edited by acid_kewpie; 11-13-2008 at 08:00 AM.
 
Old 11-13-2008, 08:14 AM   #3
Dutch2005NL
LQ Newbie
 
Registered: Nov 2008
Location: The Netherlands
Distribution: Ubuntu
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by acid_kewpie View Post
while [ 1 ]; do rdesktop -a -b -c -d; done

your recursion is pretty horrible. every time you run it round you spawn another depth of recursion. if you close remote desktop 20 times you have 20 instances of the batch file running, each one waiting on it's spawned clone. yuck. in batch just use a label and a goto statement instead.
thnx i'll try it out in a second

well i could add a exit at the end of the script... so it closes itself ;-), then again, its mostly office workers... they turn the pc on at 8-9AM and turn it off at 5-6PM, they never log out, only at some places the comp would swap between 3 shifts, and gets turned out a-lot too...

thnx for the insights though


my 2nd questions would be...

i guess i open a editor as root (sudo) insert the command, then were & how do i safe it? without an extension? script COULD be saved in the users my documents... as the dont use the local machine, and dont have knowledge of linux at all... hardly windows experienc....

Last edited by Dutch2005NL; 11-13-2008 at 08:16 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to loop over text file lines within bash script for loop? johnpaulodonnell Linux - Newbie 9 07-28-2015 04:49 PM
bash loop within a loop for mysql ops br8kwall Programming 10 04-30-2008 04:50 AM
converting shell while loop to for loop farkus888 Programming 8 09-12-2007 03:30 AM
for loop only works properly on first loop symo0009 Programming 1 12-25-2005 06:17 PM
rdesktop cheyrou Linux - Software 4 07-28-2004 10:00 PM


All times are GMT -5. The time now is 04:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration