There is a parameter that I need to grep from a file and then I need to get that parameter into another file. I need to read the variable at boot time and have it inserted in
$grep "id" /file/one | cut -d " " -f2
$12345
So now I have the ID_VAR of 12345. Now what I would like to do is use this in /file/two
In file/two:
...
@program ID_VAR
...
Is there a way to run the grep function inside file two? Is there a way to share a variable between files? I am using Debian.
grepanidfrom one file and append to another file prepended with the string@program:echo '@program' $(grep "id" file/one | cut -d " " -f2) >> file/two