Shell Script (adding a prefix to output lines)
Hello, I'd like to ask about a command in the shell which would allow me to add a prefix to the an output of mulitple lines. Like say when I do a command:
ls is there a way to prefix it outputs with a string "string here" such that it will look like this string here file1 string here file2 string here file3 string here anotherfile instead of file1 file2 file3 anotherfile |
Code:
#!/bin/bash |
Or just:
Code:
ls | sed 's/.*/string here &/' |
I wasn't really using it for ls, but the second one works great. Thanks Hko!
|
All times are GMT -5. The time now is 08:23 PM. |