Search Results

Search: Posts Made By: saurabh kumar
4,336
Posted By RudiC
Well, try this on multiple patterns in file2:awk ...
Well, try this on multiple patterns in file2:awk '/< [0-9]+[acd][0-9]+/ {SRC[$2]; next}
$1 in SRC {print PATH}
$1 ~ /^\// ...
4,336
Posted By RudiC
Tryawk 'NR==2 {SRC=$2; next} $1==SRC {print PATH}...
Tryawk 'NR==2 {SRC=$2; next} $1==SRC {print PATH} $1~/^\// {PATH=$1}' file2 file1
/home/saurabh/file1.txt
4,336
Posted By rajamadhavan
May not be the best way, but it can do the job...
May not be the best way, but it can do the job for you..


var=$(grep "< [^- ><]" file2.txt | sed -e 's/< //g')
awk -v pat=$var '/^\/.+/{a=$0;} $0 ~ pat{print a;exit}' file1.txt
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 09:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy