From: Geoff Clare on 15 Jun 2010 08:35 John Kelly wrote: > On Tue, 15 Jun 2010 14:13:27 +1000, Ben Finney > <ben+unix(a)benfinney.id.au> wrote: > >>srikanth <srikanth007m(a)gmail.com> writes: >> >>> On Jun 14, 9:20�pm, John Kelly <j...(a)isp2dial.com> wrote: >>> > while read; do >>> > � � xdg-open "$REPLY" >>> > done <$1 >>> John, >>> Here "$REPLY" means what? >> >>It means "current value of the REPLY variable". The double quotes >>instruct the shell not to perform word splitting and glob expansion. > > The "while read" loop reads the file line by line, and puts one line at > a time into $REPLY. > > You can write a while read loop to use a different variable name, but > $REPLY is the default variable name. ... in shells that support this non-standard feature. (POSIX requires that read is passed at least one variable name.) -- Geoff Clare <netnews(a)gclare.org.uk>
From: John Kelly on 15 Jun 2010 09:09 On Tue, 15 Jun 2010 13:35:40 +0100, Geoff Clare <geoff(a)clare.See-My-Signature.invalid> wrote: >> The "while read" loop reads the file line by line, and puts one line at >> a time into $REPLY. >> >> You can write a while read loop to use a different variable name, but >> $REPLY is the default variable name. > > ... in shells that support this non-standard feature. > >(POSIX requires that read is passed at least one variable name.) I didn't know that. I tend to explore the features of my favorite tools. But I suppose POSIX has a place in the world. -- Web mail, POP3, and SMTP http://www.beewyz.com/freeaccounts.php
From: srikanth on 15 Jun 2010 11:20 On Jun 15, 9:48 am, Bit Twister <BitTwis...(a)mouse-potato.com> wrote: > On Mon, 14 Jun 2010 21:09:24 -0700 (PDT), srikanth wrote: > > Is there a way to kill the browser after each iteration? > > Put the browser in the background and use pkill to kill the browser. > > while read -r url ; do > xdg-open "url" & > sleep 2 > pkill $USER xdg-open > done <$1 The browser is not killing instead it is opening all URLs in new tab.
From: srikanth on 15 Jun 2010 11:22 On Jun 15, 4:42 pm, John Kelly <j...(a)isp2dial.com> wrote: > On Tue, 15 Jun 2010 14:13:27 +1000, Ben Finney > > <ben+u...(a)benfinney.id.au> wrote: > >srikanth <srikanth0...(a)gmail.com> writes: > > >> On Jun 14, 9:20 pm, John Kelly <j...(a)isp2dial.com> wrote: > >> > while read; do > >> > xdg-open "$REPLY" > >> > done <$1 > >> John, > >> Here "$REPLY" means what? > > >It means current value of the REPLY variable . The double quotes > >instruct the shell not to perform word splitting and glob expansion. > > The "while read" loop reads the file line by line, and puts one line at > a time into $REPLY. > > You can write a while read loop to use a different variable name, but > $REPLY is the default variable name. > > -- > Web mail, POP3, and SMTPhttp://www.beewyz.com/freeaccounts.php Ok now it makes sense to me.
From: John Kelly on 15 Jun 2010 11:26
On Tue, 15 Jun 2010 08:20:49 -0700 (PDT), srikanth <srikanth007m(a)gmail.com> wrote: >On Jun 15, 9:48�am, Bit Twister <BitTwis...(a)mouse-potato.com> wrote: >> On Mon, 14 Jun 2010 21:09:24 -0700 (PDT), srikanth wrote: >> > Is there a way to kill the browser after each iteration? >> >> Put the browser in the background and use pkill to kill the browser. >> >> while read -r url ; do >> � xdg-open "url" & >> � sleep 2 >> � pkill $USER xdg-open >> done <$1 > >The browser is not killing instead it is opening all URLs in new tab. Why do you want to open all these urls with a script? What is your objective? -- Web mail, POP3, and SMTP http://www.beewyz.com/freeaccounts.php |