Unable to pass shell script variable to awk command in same shell script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist.

diff=$1$2.diff 
id=$2 new=new_$diff  
echo "My id is $1" 
echo "I want to  sync for user account $id"  
##awk command I am using is as below  
cat  $diff | awk -F'~' ''$2 == "$id"' {print $0}' > $new

I also tried below options but no success, please suggest.

awk -F'~' -v search=$id '$2 == "search" {print $0} file'  nayaka2almadm1.diff > $new
cat $diff | awk -v "search=$id" -F'~'  '$2 == "search" {print $0}' > $new
cat $diff | awk -F'~' -v  search="$id" '$2 ~ "^\"search {print $0}' > $new
awk -v  search="$id" file="$diff" | awk -F'~' '$2 == search {print $0} file'  > $new
awk -F'~' -v search="$id" '$2 == search {print $0} file'  nayaka2almadm1.diff > $new

Do not post technical questions in non-technical forums.

This is the second time today, so you have been set to "Read Only", sorry.

Follow forum rules, directions and guidelines.