You are not logged in.
Pages: 1
Hello,
i am using the code :
ls -1
and i would like to know how can i add at the beginning of each result the + character . for example i would like the output to look like :
+final.doc
+music.txt
+old.pdf
which command do i need to use ?
Thank you .
That sounds like an odd thing to want to do... What are you trying to accomplish, exactly?
But, there are various ways you could do it... Personally, off the top of my head, I'd probably reach for good old "sed":
ls -1 | sed -e 's/^/+/'
Though, really, once you've got a pipe in there, the "-1" is no longer needed, since that's the default mode when piping ls's output...
Offline
Pages: 1