|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
scripting in b shell
how can I lines from grep?
can't I just do while read x do echo x done < `grep -v "^$" test.txt`
__________________
Thank you for any help. |
|
#2
|
|||
|
|||
|
> and < redirect to files. For processes, you have to use a pipe. (note that I also removed the backticks)
Code:
grep -v "^$" test.txt | while read x do echo x done (untested)
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#3
|
|||
|
|||
|
Quote:
... Also, you should escape the "$" to "\$" or the shell may think that you're referring to a variable. M. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > scripting in b shell |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|