Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-09-2004, 07:19 AM   #1
LQ Newbie
Registered: Sep 2003
Location: UK
Distribution: Debian, Gentoo, Ubuntu
Posts: 10

Rep: Reputation: 0
running root-tail from shell script not working

I'm trying to write a simple shell script which counts the number of .torrent files in a directory, then creates an instance of root-tail where the height of the window is the same as the number of files +2 (root-tail will then display the output of my bit torrent sessions)

I managed to get it to work as I wanted it at the command line with:
$ root-tail -g 200x$num+1+600 /mnt/torrent/log/torrent.log
where $num is the height i want the window to be, but when I wrote the following script it spat out '6+1+620: No such file or directory'

num=$(ls /mnt/torrent/torrentfiles/*.torrent | wc -l)
root-tail -g 200x$num+1+620 /mnt/torrent/log/torrent.log

As this is my first attempt at shell script, I'm certain I'm just doing something stupid (hence posting this in the newbie forum and not programming or software,) and I'd really appreciate any guidance..
Thanks for your help,
Old 04-09-2004, 08:56 AM   #2
LQ Newbie
Registered: Sep 2003
Location: UK
Distribution: Debian, Gentoo, Ubuntu
Posts: 10

Original Poster
Rep: Reputation: 0
Never mind, I managed to get round the problem by using an arithmetic function within the arguments for root-tail, which works fine:
root-tail -g 200x$(expr $num + 2)+1+620 /mnt/torrent/log/torrent.log

Thanks anyway


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
root-tail working only in rootGUI. window id option in user mode does not solve issue Emmanuel_uk Linux - Newbie 3 11-16-2005 01:04 AM
running SHell script from java anirudh Programming 2 01-07-2005 07:37 AM
Running shell script install, how? henrikanttonen Linux - Newbie 9 08-06-2004 08:46 PM
creating shell script that executes as root regardless of who runs the script? m3kgt Linux - General 13 06-04-2004 10:23 PM
c/c++ running a shell script? thermalpants Programming 3 05-12-2002 11:41 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:11 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
Open Source Consulting | Domain Registration