can some give me a example ?
eg:
a=usb
I want to use variable "a" as separator
Your question can be interpreted several ways. The obvious answer is:
FS=a
If this isn't what you want, you'll need to give us some context.
Hello,
Here is an example for same.
Lets say we have saved an variable like as follows.
a="test1"
Example input file is as follows:
cat test1211
test test1 test2
singh test1 tet3
gurmeet test1 test4
Code is as follows:
awk -F"$a" '{print $1 OFS $2}' test121
Output will be as follows:
test test2
singh tet3
gurmeet test4
Thanks,
R. Singh