![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
using sed
hi.. i am trying to find files containing a certain text. the following is my code
Code:
find . -exec grep -l "sometexttobefound" '{}' \; -print | uniq | sed 's/[\r\n]/,/g' `
infact, not quite sure if my regular exp is right for carriage return. ???? |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
var=$(find . -exec grep -l "sometexttobefound" '{}' \;)
var=$(echo $var | sed 's/ /,/g')
echo $var
|
|||
| Google The UNIX and Linux Forums |