I am new to shell scripting, and would appreciate your help on following problem.
I need to search a file for a pattern, then get the number of each line that matches the given pattern.
Then I need to search those specific line numbers from the first file in a second file and print the entire lines.
I tried with grep -n 'pattern' from the first file, which gives me:
I know sed and awk has options to give range of line numbers, but
I need to replace pattern in specific lines
sed -e '1s,14s,26s/pattern/new pattern/' file name
Can somebody help me in this....