Sponsored Content
Top Forums Shell Programming and Scripting How to use shell script's to get EPG Program with SED Post 302144160 by single on Tuesday 6th of November 2007 01:08:02 PM
Old 11-06-2007
Tools How to use shell script's to get EPG Program with SED

This is my test script version:

Code:
#!/bin/sh
wget -q -O /tmp/axn 'http://www.axn.pt/programacion/'
sed -e '/^$/ d' /tmp/axn > /tmp/temp     #Clean black space

sed -e 's/<[^>]*>//g' /tmp/temp > /tmp/temp1  #Remove HTML
rm -f /tmp/temp    # Step by step script then clean one by one
sed 's/>[    ]*</></g'  /tmp/temp1 > /tmp/temp2
#
rm -f /tmp/temp1
sed -e '/^$/ d' /tmp/temp2 > /tmp/temp3     #Clean empty space
rm -f /tmp/temp2
sed -n '102,130p' /tmp/temp3 > /tmp/temp4 # Print line 102 to 103
rm -f /tmp/temp3
sed -e '/^$/ d' /tmp/temp4 > /tmp/temp5     #Clean empty space
rm -f /tmp/temp4
sed 's/^\([0-9][0-9]:[0-9][0-9]\)/\n\1/g' /tmp/temp5 > /tmp/temp6
rm -f /tmp/temp5
sed -e 's/&.*;//g' /tmp/temp6 > /tmp/temp7
rm -f /tmp/temp6
cat /tmp/temp7  # Show temp7
fi

and the result is this:

Code:
Manhã
                
        06:26C.S.I. Nova Iorque07:10Hospital Central08:33Sem Rasto09:20Stingers: Infiltrados10:15C.S.I. Nova Iorque11:05Hospital Central12:30C.S.I. Miami13:25Asas nos Pés14:15Medium

This is the Programs of this channel, this channel have no EPG on it, then using internet i can go to that web pag. and grab the "EPG"

Well the problem is that is not what i have in mind is something like this:
Code:
Manhã               
06:26 C.S.I. Nova Iorque
07:10 Hospital Central
08:33 Sem Rasto
09:20 Stingers: Infiltrados
10:15 C.S.I. Nova Iorque
11:05 Hospital Central
12:30 C.S.I. Miami
13:25 Asas nos Pés
14:15 Medium

Smilie

Another think this is not to be used in a PC but in STB Linux based.


Maby a xml aproch will be better, any ideas?
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

shell script program

shell script for sorting,searchingand insertion/deletion of elements in a list (1 Reply)
Discussion started by: jayaram_miryabb
1 Replies

2. Shell Programming and Scripting

How to use sed within shell program?

Hi, I tried this with my shell program and it didn't work: /usr/ucb/sed '/$employeeID/d' /usr1/log/logfile How to let sed see my variable employeeID within my shell program? Thanks! (1 Reply)
Discussion started by: whatisthis
1 Replies

3. Shell Programming and Scripting

Need help on C-shell script program

#!/bin/csh # This program will add integers # # # add integer1 .. # # Check for argument if ($#argv == 0 ) then echo "usage: add integers" exit 1 else set input = $argv endif # set sum = 0 foreach var ( $input ) @sum = $sum + $input end # (1 Reply)
Discussion started by: haze21
1 Replies

4. Shell Programming and Scripting

please convert the below program into shell script

if ( ( grep -i "Exception : " /home/dklog* )) then echo " improper combination" elsif ( ( grep -i "invalid" /home/dklog*)) then echo " wrong process " fi fi in the above case i am facing the the syntx error please help in this case... (3 Replies)
Discussion started by: mail2sant
3 Replies

5. Shell Programming and Scripting

Call C Program From Shell Script

Hi, Could anybody please let me know how to call a C_Program from shell script. I know through command "system" we can call shell script from C program. Awaiting response. Thanks and regards, Chanakya M (4 Replies)
Discussion started by: Chanakya.m
4 Replies

6. Shell Programming and Scripting

C program to execute shell script

Hi, Can anyone pls give a sample to execute a shell script from C program Thanks (2 Replies)
Discussion started by: baigmd
2 Replies

7. Shell Programming and Scripting

shell program with sed

I want to substitute a charactor "PAN" with "TAN" in a shell, I used sed command in shell, it wo'nt work but the same is run from command prompt it was successful. the command is sed ' s/PAN/TAN/g ' <i/p> > <o/p> sed ' s/^M/^M/g ' <i/p> > <o/p> (1st ^M is Ctrl+V+M, 2nd should be line feed/next... (1 Reply)
Discussion started by: anil_kut
1 Replies

8. Shell Programming and Scripting

shell script program

shell script in Unix/Linux to find the lines numbers of a text file are having word which is 5 to 10 characters long and having first letter as a capital letter. (3 Replies)
Discussion started by: usersnehal
3 Replies

9. Homework & Coursework Questions

Need help writing a shell script program

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write the a shell script program to remove all space characters stored in the shell variable TEXT.... (7 Replies)
Discussion started by: kofine05
7 Replies

10. Shell Programming and Scripting

Controlling a program from shell script

Hi all, I am trying to write a shell script that starts a program, reads from its stdout and can write to its stdin. I'm having trouble to get it to work, I tried using named pipes, and using exec and file descriptors. Just couldn't get it to work, so I thought I'll post it here to see if... (4 Replies)
Discussion started by: test it
4 Replies
xfs_estimate(8) 					      System Manager's Manual						   xfs_estimate(8)

NAME
xfs_estimate - estimate the space that an XFS filesystem will take SYNOPSIS
xfs_estimate [ -h? ] [ -b blocksize ] [ -i logsize ] [ -e logsize ] [ -v ] directory ... DESCRIPTION
For each directory argument, xfs_estimate estimates the space that directory would take if it were copied to an XFS filesystem. xfs_esti- mate does not cross mount points. The following definitions are used: KB = *1024 MB = *1024*1024 GB = *1024*1024*1024 The xfs_estimate options are: -b blocksize Use blocksize instead of the default blocksize of 4096 bytes. The modifier k can be used after the number to indicate multiplica- tion by 1024. For example, xfs_estimate -b 64k / requests an estimate of the space required by the directory / on an XFS filesystem using a blocksize of 64K (65536) bytes. -v Display more information, formatted. -h Display usage message. -? Display usage message. -i, -e logsize Use logsize instead of the default log size of 1000 blocks. -i refers to an internal log, while -e refers to an external log. The modifiers k or m can be used after the number to indicate multiplication by 1024 or 1048576, respectively. For example, xfs_estimate -i 1m / requests an estimate of the space required by the directory / on an XFS filesystem using an internal log of 1 megabyte. EXAMPLES
% xfs_estimate -e 10m /var/tmp /var/tmp will take about 4.2 megabytes with the external log using 2560 blocks or about 10.0 megabytes % xfs_estimate -v -e 10m /var/tmp directory bsize blocks megabytes logsize /var/tmp 4096 792 4.0MB 10485760 % xfs_estimate -v /var/tmp directory bsize blocks megabytes logsize /var/tmp 4096 3352 14.0MB 10485760 % xfs_estimate /var/tmp /var/tmp will take about 14.0 megabytes xfs_estimate(8)
All times are GMT -4. The time now is 08:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy