Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-23-2008, 04:26 AM   #1
LQ Newbie
Registered: Dec 2008
Location: Amsterdam, Holland
Distribution: Ubuntu and TinyMe
Posts: 4

Rep: Reputation: 0
start application using shell script


I'm kind of new to shell scripts..
I want to start an application when the dhcp3-server sends out a lease

I got the line:

ip=sudo tail /var/log/syslog | grep "dhcpd: DHCPACK" | cut -d " " -f 9
echo $ip


Now I'd like my app to start so no echo anymore
In the terminal you would start it as "appname"

Is that possible and can the app start as a new thread?
So you could run it twice at the same time?

Thanks a lot,
Old 12-23-2008, 08:09 PM   #2
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,147

Rep: Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887Reputation: 887
not quite sure what you are trying to do. also [code] tags make it easier to read.

^i think you are missing backticks
ip=`sudo tail /var/log/syslog | grep "dhcpd: DHCPACK" | cut -d " " -f 9`
now if you want to run a program then add this line to your shell script:
appname &
the & sends it to the background the script will go to the next line without waiting for it to finish.

this seems more programming appropriate.
Old 12-24-2008, 12:51 PM   #3
LQ Newbie
Registered: Dec 2008
Location: Amsterdam, Holland
Distribution: Ubuntu and TinyMe
Posts: 4

Original Poster
Rep: Reputation: 0
Sorry for being so unclear

I'd like to make it continuous so I added the -f to tail.
every time there is a dhcpack in the syslog the application should start with the ip address as an parameter value.

In the terminal you could start the application this way:
appname ip
For instance:
Thanks for your help man:P


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
Converting a shell script with dialog boxes into a GNOME application kushalkoolwal Programming 4 10-17-2008 06:21 AM
executing shell script from java application maheshkodamati Programming 5 02-24-2008 11:39 AM
Opening file with default application from shell script? bourbon_beast Programming 4 04-13-2004 01:52 AM
How to bring up application window to front from shell script. aleksas_m Linux - General 2 08-21-2003 01:22 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:39 PM.

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