maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Newbie (https://talk.maemo.org/forumdisplay.php?f=26)
-   -   a simple talking IP address utility for flite (https://talk.maemo.org/showthread.php?t=15521)

missaghi 2008-01-24 22:32

Re: a simple talking IP address utility for flite
 
i wanted it to say "one two seven" instead of "one hundred and twenty seven" here you go:

/sbin/ifconfig |sed s/wlan/w-lan/| awk '/^[^ ]/ {interf = $1} /inet addr:/ {print interf", I P is ,:"$2}'|grep -v 127.0.0.1|cut -d: -f1,3| awk -F: '{ {a = " "} {for (i = 1; i <= length($2); i++) {a = (a (substr($2,i,1) " " )) }} {print ($1 a)} } ' |awk -F. '{print $1", dot "$2", dot "$3", dot "$4}' | flite

thanks benson for putting in the "dot" and thanks linux_author for making it in the first place. I took me an hour but it's the first time i've used awk so it was fun.

linux_author 2008-01-24 23:31

Re: a simple talking IP address utility for flite
 
Quote:

Originally Posted by missaghi (Post 133310)
thanks benson for putting in the "dot" and thanks linux_author for making it in the first place. I took me an hour but it's the first time i've used awk so it was fun.

- great!

- and that's the point, isn't it?

'Have a lot of fun!'

:-)

(it's nice to be able to easily craft customized software tools)

HWL 2008-01-26 03:43

Re: a simple talking IP address utility for flite
 
[QUOTE=linux_author;131986- note that the script is stored under /home/user/apps as IPTalk.sh[/QUOTE]

a little guidance please...
so I got the now renamed IPTalk.sh onto the internal memory card. Then Xtermed over to /media/mmc2 and copied the file to the (su) /home/user/apps directory where I can see it.

How do I launch it from the folder location or do I need to have the desktop applet/icon running?

nhanquy 2008-01-26 04:35

Re: a simple talking IP address utility for flite
 
Quote:

Originally Posted by HWL (Post 133912)
How do I launch it from the folder location or do I need to have the desktop applet/icon running?

[in a xterm window]
chmod +x /home/user/apps/IPTalk.sh
sh /home/user/apps/IPTalk.sh



if you have osso-statusbar-cpu installed then you can set a new command with "sh /home/user/appsIPTalk.sh"

HWL 2008-01-28 03:23

Re: a simple talking IP address utility for flite
 
whats the difference between the original script and this one below in terms of getting this one operating? Are they interchangeable or do I need to modify something....
Thanks

/sbin/ifconfig |sed s/wlan/w-lan/| awk '/^[^ ]/ {interf = $1} /inet addr:/ {print interf", I P is ,:"$2}'|grep -v 127.0.0.1|cut -d: -f1,3| awk -F: '{ {a = " "} {for (i = 1; i <= length($2); i++) {a = (a (substr($2,i,1) " " )) }} {print ($1 a)} } ' |awk -F. '{print $1", dot "$2", dot "$3", dot "$4}' | flite

Also, whats the N800's equivalent editor to Vi for Xterm?

Benson 2008-01-28 15:58

Re: a simple talking IP address utility for flite
 
Quote:

Originally Posted by HWL (Post 134621)
whats the difference between the original script and this one below in terms of getting this one operating? Are they interchangeable or do I need to modify something....

There's 3 scripts posted here: linuxauthor's, mine, and missaghi's. Any of them will work the same; there's some difference of functionality with multiple interfaces, and differences in the exact speech (a matter of taste). Oddly enough, I prefer mine ;); choose whichever you like best... and feel free to tweak it to suit you.

Quote:

Also, whats the N800's equivalent editor to Vi for Xterm?
vi

I use JOE, some people like pico; both of these are packaged and available from repos, but vi is preinstalled.

HWL 2008-01-28 16:26

thanks...
I loaded emelFM2 and have been reading up on awk.


All times are GMT. The time now is 14:49.

vBulletin® Version 3.8.8