title: script accept file via STDIN redirection and output result to a file in a specifical way
body: <pre><code>a:123234343
  b:175645453
  c:aadfefee
  </code></pre>
  
  <p>This is file named "user" which the script should accept. I know (cat user) can get all the data from file "user". However, i want to read the data and only keep "a:" as a variable and compare "123234343" with data from another file named "password". </p>
  
  <pre><code>abcdefg
  1234
  arrewewe
  </code></pre>
  
  <p>This is "password" file. In my script, i will get these data and using sha256sum to get the hashing value, and compare the hashing value with data(e.g. 123234343) from file "user".If the hashing value is same as data from file "user", i need to output the result to a new file named "result". The output should look like "a:abcdefg". I know (>result) will send some data to the "result" file.</p>
  
  <p>So i think there is a way to store "a:" as a variable, and store "123234343" as another variable. But i don't know how to do it, or there is an easy way than this.</p>