I have a text file with lots of package names.
package1
package2
# comment
# installing package3 because it was needed for...
package 3
package 4
How can I mass install all packages inside the text file without removing the comments?
|
I have a text file with lots of package names.
How can I mass install all packages inside the text file without removing the comments? |
|||
|
|
|
Something along these lines ought to do the trick.
The $(something) construction runs the something command, inserting its output in the command line. The grep command will exclude any line beginning with a #, optionally allowing for whitespace before it. Then the tr command replaces newlines with spaces. |
|||||||||||||
|
|
The following command is a (slight) improvement over the alternative because
Note that the |
|||||||||||||||||
|