LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 02-02-2013, 04:24 PM   #1
mahkoe
LQ Newbie
 
Registered: Oct 2011
Posts: 25

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

Thanks!
 
Old 02-03-2013, 11:48 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Location: Wales, UK
Distribution: Arch
Posts: 1,630
Blog Entries: 3

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

Code:
fancy_sed_command | while read line; do
    xdg-open $line
done
or

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

Regards,
 
  


Reply


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 05:09 AM
a weird xdg-open issue Oxpoto Linux - Software 0 07-23-2011 03:56 AM
[SOLVED] xdg-open: no method available for opening Amdx2_x64 Programming 2 07-01-2011 02:31 PM
xdg-open, gnome-open or kde(4?)-open??? akamikeym Programming 0 08-03-2010 08:54 AM
List all files and recursively open directories. unreal128 Linux - General 2 07-16-2005 02:06 PM


All times are GMT -5. The time now is 01:47 PM.

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