I am on CentOS 6.6. I have a program that runs analysis and outputs its data in html files.
The file structure is
dir1/dir1.html
dir2/dir2.html
dir3/dir3.html
I want to open all three html files from a bash one liner, e.g.
for i in dir*; do firefox --new-tab $i/${i}.html; done
This opens the files individually, such that the first html file must be closed before the second one opens. If I try to send it as a background process, e.g.
for i in dir*; do firefox --new-tab $i/${i}.html&; done
I get:
-bash: syntax error near unexpected token `;'
I also tried the same method as in this post, but it still opens them individually.
How can I open these all in the same tab using a little bash one-liner?
&
ends the command, so you don't need the;
– Jan 21 '16 at 20:12&&
doesn't (just) terminate a command; it separates two commands.&
and;
are both terminators that don't explicitly require a subsequent command – Chris Davies Jan 21 '16 at 21:19firefox '--new-tab' "$i/${i}"'.html&';
if you want to include the &. Usefirefox '--new-tab' "$i/${i}"'.html' &
(no;
) as the&
already signals the end of the command. – Jan 21 '16 at 22:51