How to pass special character as parameter?

I need to pass congruent or comma character as parameter. i have tried congruent and it prints home directory. is escape char required. And also in awk i have to pass the no to print a column. e.g awk '{print $Param}'

somecmd  \'  '.,$;|'   "\\ , \$ "

awk -v param="$Param" '{ print param }'

awk -v a="~" -v b="5" 'BEGIN{OFS=FS=a}{$b="test"}{print}' filename

im trying like this problem is when passing ~ im getting error.

how do i pass this character and execute the awk script.

Try with single quotes. '~'

cahr= "$1"

+ cahr=
+ '~'
temp.sh: line 11: ~: command not found

when running this is the error im getting

This message is not coming from awk but from your script shell. Could you post the script that you are trying to run?

#!/bin/sh

cahr="$1"
col1=$2

awk -v a="$cahr" -v b=$col1 'BEGIN{OFS=FS=a}{$b="test"}{print}' filename

this is the script im executing.

But the error message is coming from line 11 and this script does not have that many lines and it does not have the -x option set. Are you sure that is the right one?

I noticed there is a space on the first line between cahr and "$1" that should not be there.