Greetings, All.
I'm trying to get some data out of fileA.txt for use as a variable in script.sh. I think I want to use awk, but I'm not sure how to go about it.
fileA.txt:
Code:
1234567890,207699107669,00AABBCCDDB7:1,A
awk:
Code:
awk 'BEGIN { FS = "," } ; { print $1 }' fileA.txt
that gives me 1234567890, which is what I want - but I want to use it in place of $variable in:
Code:
#!/bin/bash
variable=$1
sed "s|aaaa|$variable|g" <template.txt> readyfile.txt
I hope that makes sense, and I'm reasonably sure it's something simple, but I just can seem to get it together...
Any assistance is appreciated!!!