23.04.2024, 10:22 UhrDeutsch | English
Hallo Gast [ Registrierung | Anmelden ]

Neues Thema eröffnen   Neue Antwort erstellen
Vorheriges Thema anzeigen Druckerfreundliche Version Einloggen, um private Nachrichten zu lesen Nächstes Thema anzeigen
Autor Nachricht
w1av
Titel: help with script file  BeitragVerfasst am: 14.06.2006, 02:33 Uhr



Anmeldung: 26. Okt 2005
Beiträge: 146
Wohnort: Out There
Hello. I have 2 very simple bash files. One gives you the 10 day forecast and the other gives you the current movie listings locally. Here are the 2 1-line scripts:

#!/bin/bash
## Check movies at Stonington Theater
clear
links -dump "http://movies.yahoo.com/showtimes/?z=02891#T1/print" |more


#!/bin/bash
##Weather report for westerly
clear
links -dump "http://www.weather.com/weather/print/02891"


These run in the Konsole and use the text browser "links" to display the data. The movie script lists movies for not one but about 6 or 7 local theaters. There is no way to have it display shows at just one theater cause they are all grouped together on the website. I would like to be able to get the script to find a line of text, and COLOR IT so I can spot it right away without having to scroll thru the list. I am not too clear on how to get the Konsole to display colors. I only need 1 row of text colored (any color). Is this possible? Is there some other code I can insert in the script I made to do this? If I can do this then I can play around with the weather script I made....any ideas???????

_________________
"Kanotix....what, me worry?!"
 
 Benutzer-Profile anzeigen Private Nachricht senden  
Antworten mit Zitat Nach oben
schnorrer
Titel: help with script file  BeitragVerfasst am: 14.06.2006, 12:52 Uhr



Anmeldung: 09. Jan 2006
Beiträge: 1720

on the console coloring is done with ESC-seq.
 
 Benutzer-Profile anzeigen Private Nachricht senden  
Antworten mit Zitat Nach oben
severin
Titel: help with script file  BeitragVerfasst am: 14.06.2006, 13:01 Uhr



Anmeldung: 18. Mar 2004
Beiträge: 3417

@w1av:
wouldn't it be easier to pipe links' output to grep instead thus filtering your theatre of choice? Maybe using one of the context options (cf. "man grep")

_________________
Kein Wort verstanden? Auf http://kanotix.com/index.php?module=pnW ... uerDummies
gibt's ein Glossar.

No clue what I'm talking about? New to Linux? Check http://kanotix.com/index.php?module=pnW ... ForDummies for a glossary.
 
 Benutzer-Profile anzeigen Private Nachricht senden Website dieses Benutzers besuchen ICQ-Nummer 
Antworten mit Zitat Nach oben
w1av
Titel: grep help?  BeitragVerfasst am: 19.06.2006, 14:40 Uhr



Anmeldung: 26. Okt 2005
Beiträge: 146
Wohnort: Out There
Well I have been closely reading the manpage for GREP but still cannot come up with a solution! I would like to be able to use GREP but its a little daunting.

wouldn't it be easier to pipe links' output to grep instead thus filtering your theatre of choice? Maybe using one of the context options (cf. "man grep")

I would like to be able to do this cause it is a much faster way to get info real quickly without waiting for web pages to load, or even waiting for browser to open. And I would be able to view exactly what I want! I read about greps ability to find a "pattern" in a body of text. The text I am trying to highlight on screen when links sends it, changes often when the movie theater changes its movie listings. The only reference point I have is at the beginning of each theater's listings, is the ADDRESS of the theater. So I am trying to use that address as a reference to start cause thats something that doesnt change, like movie titles over time.
So when I run the script, when text appears I just look for the theaters address (the one I go to). I know this may sound stupid but I think it's a good way to learn some ofthe command line stuff I want to know.
When I need quick info like weather and movie listings, its quicker to use the Konsole with Links. The only major drawback is I cannot access my email (to send) with Links. It doesnt support ssl something or other....So I have been using PINE and its much faster than waiting for web based email. Anyway any more help would be appreciated!....thanks Geschockt

_________________
"Kanotix....what, me worry?!"
 
 Benutzer-Profile anzeigen Private Nachricht senden  
Antworten mit Zitat Nach oben
schnorrer
Titel: grep help?  BeitragVerfasst am: 19.06.2006, 19:32 Uhr



Anmeldung: 09. Jan 2006
Beiträge: 1720

normaly use:

grep -f 'things to find' infile.

or

cat /filelocation/file | grep -f word | next program in row to handle the output fom grep

hope this 2 examples will help you a bit. an pleas look at the diff how to handle one word or the whole pattern.
 
 Benutzer-Profile anzeigen Private Nachricht senden  
Antworten mit Zitat Nach oben
Beiträge vom vorherigen Thema anzeigen:     
Gehe zu:  
Alle Zeiten sind GMT + 1 Stunde
Neues Thema eröffnen   Neue Antwort erstellen
Vorheriges Thema anzeigen Druckerfreundliche Version Einloggen, um private Nachrichten zu lesen Nächstes Thema anzeigen
PNphpBB2 © 2003-2007 
 
Deutsch | English
Logos and trademarks are the property of their respective owners, comments are property of their posters, the rest is © 2004 - 2006 by Jörg Schirottke (Kano).
Consult Impressum and Legal Terms for details. Kanotix is Free Software released under the GNU/GPL license.
This CMS is powered by PostNuke, all themes used at this site are released under the GNU/GPL license. designed and hosted by w3you. Our web server is running on Kanotix64-2006.