Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-02-2013, 05:24 PM   #1
LQ Newbie
Registered: Oct 2011
Posts: 26

Rep: Reputation: Disabled
open list of files with xdg-open

I have a fancy sed command in a bash script that, depending on command parameters, returns a list of files separated by a newline. I would like to use xdg-open to open all the files, but xdg-open can apparently only take one file at a time. I am pretty new at bash scripting, so I was wondering if anyone has a way getting around this problem and opening all the files with xdg-open

Old 02-03-2013, 12:48 PM   #2
Senior Member
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 345Reputation: 345Reputation: 345Reputation: 345

fancy_sed_command | while read line; do
    xdg-open $line

fancy_sed_command | while read line; do
    xdg-open $line &
if you want them all opened at the same time, not one by one



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] xdg-open doesn't recognize custom protocol mickael.cruz Linux - Desktop 1 10-25-2012 06:09 AM
a weird xdg-open issue Oxpoto Linux - Software 0 07-23-2011 04:56 AM
[SOLVED] xdg-open: no method available for opening Amdx2_x64 Programming 2 07-01-2011 03:31 PM
xdg-open, gnome-open or kde(4?)-open??? akamikeym Programming 0 08-03-2010 09:54 AM
List all files and recursively open directories. unreal128 Linux - General 2 07-16-2005 03:06 PM

All times are GMT -5. The time now is 03:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration