Sponsored Content
Top Forums Shell Programming and Scripting Script reading from file and send to firefox Post 302773285 by zigizag on Thursday 28th of February 2013 01:36:44 AM
Old 02-28-2013
wow!! thanks alot!!

Quote:
Originally Posted by bipinajith
Please always wrap code fragments or data samples in code tags

Here is modified code that redirects output to file: output.txt
Code:
#!/bin/bash

while read line
do
        [[ "$line" =~ ^server1.com ]] && url_s1=${line##*: }
        [[ "$line" =~ ^server2.com ]] && url_s2=${line##*: }
        [[ "$line" =~ ^server3.com ]] && url_s3=${line##*: }
done < 1.txt

{
        echo -n "firefox http://"
        for U in ${url_s1//,/ }
        do
                printf "${U}&2C"
        done
        echo ".com/index.html"

        echo -n "firefox http://"
        for U in ${url_s2//,/ }
        do
                printf "${U}&2C"
        done
        echo ".com/index.html"

        echo -n "firefox http://"
        for U in ${url_s3//,/ }
        do
                printf "${U}&2C"
        done
        echo ".com/index.html"
} > output.txt

---------- Post updated at 04:11 PM ---------- Previous update was at 03:59 PM ----------

thanks alot!! excellent!!

---------- Post updated 02-28-13 at 01:36 AM ---------- Previous update was 02-27-13 at 04:11 PM ----------

the thung is that i changed the txt file instead of:

server1.com : wer,wer,we

server2.com : wer,wer,we

server3.com : wer,wer,we

the new one is:

* server1.com : wer,wer,we
------------------------------
* server2.com : wer,wer,we
------------------------------
* server3.com : wer,wer,we
-------------------------------

does any body know what shoukd i change in the code??

thanks!!
 

9 More Discussions You Might Find Interesting

1. Programming

Reading a file into a C++ script

Hi, I'm trying to read a file in with and assigne the stream to a char * type. I've manged it using the cin.get returning type char, but am having run-time problems returning a char *. For example, char *pStream = "file.txt"; ifstream from(pStream); from.open(pStream); ... (1 Reply)
Discussion started by: Breen
1 Replies

2. UNIX for Dummies Questions & Answers

script to reading a file

hi, I have a file containing names, say n number of names, sample file robin smith dallas frey cook all these names are in a file name called names.txt and it is placed in a directory called /data/names all i want is to write a script, which will read from the file and gives the... (3 Replies)
Discussion started by: vasikaran
3 Replies

3. Shell Programming and Scripting

Reading file names from a file and executing the relative file from shell script

Hi How can i dynamically read files names from a list file and execute them from a single shell script. Please help its urgent Thanks in Advance (4 Replies)
Discussion started by: anushilrai
4 Replies

4. Shell Programming and Scripting

Reading Delimited file and send mail with attachment

Hi All, My requirement is: 1. To read a file that contains log file location and server name. The format of the file is something like this : server_name1:logfilename1 server_name2:logfilename2 2. Now I wants to grep "error" string from the logfilename and put it into another file for... (3 Replies)
Discussion started by: acheiver
3 Replies

5. UNIX for Dummies Questions & Answers

UNIX script for reading a file and creating another file

Hi, I am a beginner in scripting...I have to do a script where I have to read a file which has list of job names, line by line and for every line execute a dsjob command to find the log details of the job and extract only the start time of the job, if it is greater than jan 01 2008 and create... (1 Reply)
Discussion started by: Vijay81
1 Replies

6. Shell Programming and Scripting

Bash script to send lines of file to new file based on Regex

I have a file that looks like this: cat includes CORP-CRASHTEST-BU e:\crashplan\ CORP-TEST /usr/openv/java /usr/openv/logs /usr/openv/man CORP-LABS_TEST /usr/openv/java /usr/openv/logs /usr/openv/man What I want to do is make three new files with just those selections. So the three... (4 Replies)
Discussion started by: newbie2010
4 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Reading Array And Send An Email

I am trying to find an example for reading an array instead of reading a file and send out an email in ksh. Can you please help is that possible? Algorithm #!/bin/ksh i=0 set -A ARR if then let i=$ ARR="A does n't match with B" fi if then let i=$ ARR="P does n't match with Q"... (11 Replies)
Discussion started by: Ariean
11 Replies

8. UNIX for Dummies Questions & Answers

Reading XML file and print the values in the text file using Linux shell script

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies

9. Shell Programming and Scripting

ksh Script, Reading A File, Grepping A File Contents In Another File

So I'm stumped. First... APOLOGIES... my work is offline in an office that has zero internet connectivity, as required by our client. If need be, I could print out my script attempts and retype them here. But on the off chance... here goes. I have a text file (file_source) of terms, each line... (3 Replies)
Discussion started by: Brusimm
3 Replies
DateTime::Locale::rw_RW(3)				User Contributed Perl Documentation				DateTime::Locale::rw_RW(3)

NAME
DateTime::Locale::rw_RW SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'rw_RW' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Kinyarwanda Rwanda. DATA
This locale inherits from the DateTime::Locale::rw locale. It contains the following data. Days Wide (format) Kuwa mbere Kuwa kabiri Kuwa gatatu Kuwa kane Kuwa gatanu Kuwa gatandatu Ku cyumweru Abbreviated (format) mbe. kab. gtu. kan. gnu. gnd. cyu. Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) Kuwa mbere Kuwa kabiri Kuwa gatatu Kuwa kane Kuwa gatanu Kuwa gatandatu Ku cyumweru Abbreviated (stand-alone) mbe. kab. gtu. kan. gnu. gnd. cyu. Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) Mutarama Gashyantare Werurwe Mata Gicuransi Kamena Nyakanga Kanama Nzeli Ukwakira Ugushyingo Ukuboza Abbreviated (format) mut. gas. wer. mat. gic. kam. nya. kan. nze. ukw. ugu. uku. Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) Mutarama Gashyantare Werurwe Mata Gicuransi Kamena Nyakanga Kanama Nzeli Ukwakira Ugushyingo Ukuboza Abbreviated (stand-alone) mut. gas. wer. mat. gic. kam. nya. kan. nze. ukw. ugu. uku. Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) igihembwe cya mbere igihembwe cya kabiri igihembwe cya gatatu igihembwe cya kane Abbreviated (format) I1 I2 I3 I4 Narrow (format) 1 2 3 4 Wide (stand-alone) igihembwe cya mbere igihembwe cya kabiri igihembwe cya gatatu igihembwe cya kane Abbreviated (stand-alone) I1 I2 I3 I4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated BCE CE Narrow BCE CE Date Formats Full 2008-02-05T18:30:30 = Kuwa kabiri, 2008 Gashyantare 05 1995-12-22T09:05:02 = Kuwa gatanu, 1995 Ukuboza 22 -0010-09-15T04:44:23 = Kuwa gatandatu, -10 Nzeli 15 Long 2008-02-05T18:30:30 = 2008 Gashyantare 5 1995-12-22T09:05:02 = 1995 Ukuboza 22 -0010-09-15T04:44:23 = -10 Nzeli 15 Medium 2008-02-05T18:30:30 = 2008 gas. 5 1995-12-22T09:05:02 = 1995 uku. 22 -0010-09-15T04:44:23 = -10 nze. 15 Short 2008-02-05T18:30:30 = 08/02/05 1995-12-22T09:05:02 = 95/12/22 -0010-09-15T04:44:23 = -10/09/15 Default 2008-02-05T18:30:30 = 2008 gas. 5 1995-12-22T09:05:02 = 1995 uku. 22 -0010-09-15T04:44:23 = -10 nze. 15 Time Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = Kuwa kabiri, 2008 Gashyantare 05 18:30:30 UTC 1995-12-22T09:05:02 = Kuwa gatanu, 1995 Ukuboza 22 09:05:02 UTC -0010-09-15T04:44:23 = Kuwa gatandatu, -10 Nzeli 15 04:44:23 UTC Long 2008-02-05T18:30:30 = 2008 Gashyantare 5 18:30:30 UTC 1995-12-22T09:05:02 = 1995 Ukuboza 22 09:05:02 UTC -0010-09-15T04:44:23 = -10 Nzeli 15 04:44:23 UTC Medium 2008-02-05T18:30:30 = 2008 gas. 5 18:30:30 1995-12-22T09:05:02 = 1995 uku. 22 09:05:02 -0010-09-15T04:44:23 = -10 nze. 15 04:44:23 Short 2008-02-05T18:30:30 = 08/02/05 18:30 1995-12-22T09:05:02 = 95/12/22 09:05 -0010-09-15T04:44:23 = -10/09/15 04:44 Default 2008-02-05T18:30:30 = 2008 gas. 5 18:30:30 1995-12-22T09:05:02 = 1995 uku. 22 09:05:02 -0010-09-15T04:44:23 = -10 nze. 15 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 kab. 1995-12-22T09:05:02 = 22 gnu. -0010-09-15T04:44:23 = 15 gnd. Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = kab., 2-5 1995-12-22T09:05:02 = gnu., 12-22 -0010-09-15T04:44:23 = gnd., 9-15 MMM (LLL) 2008-02-05T18:30:30 = gas. 1995-12-22T09:05:02 = uku. -0010-09-15T04:44:23 = nze. MMMd (MMM d) 2008-02-05T18:30:30 = gas. 5 1995-12-22T09:05:02 = uku. 22 -0010-09-15T04:44:23 = nze. 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = kab. gas. 5 1995-12-22T09:05:02 = gnu. uku. 22 -0010-09-15T04:44:23 = gnd. nze. 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = Gashyantare 5 1995-12-22T09:05:02 = Ukuboza 22 -0010-09-15T04:44:23 = Nzeli 15 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = kab. Gashyantare 5 1995-12-22T09:05:02 = gnu. Ukuboza 22 -0010-09-15T04:44:23 = gnd. Nzeli 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = kab., 2008-2-5 1995-12-22T09:05:02 = gnu., 1995-12-22 -0010-09-15T04:44:23 = gnd., -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 gas. 1995-12-22T09:05:02 = 1995 uku. -0010-09-15T04:44:23 = -10 nze. yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = kab., 2008 gas. 5 1995-12-22T09:05:02 = gnu., 1995 uku. 22 -0010-09-15T04:44:23 = gnd., -10 nze. 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 Gashyantare 1995-12-22T09:05:02 = 1995 Ukuboza -0010-09-15T04:44:23 = -10 Nzeli yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 I1 1995-12-22T09:05:02 = 1995 I4 -0010-09-15T04:44:23 = -10 I3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Kuwa mbere SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::rw_RW(3)
All times are GMT -4. The time now is 02:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy