I have a few scripts that I constantly enter in input as below:

[support@ccfcore-3 exporttool]$ ./sendExamToRepo.sh
Enter the Study Instance UID:

The script itself uses a basic echo and read statement:

echo "Enter the Study Instance UID: "
read SUID

Is there a way I can save the input I enter into a sort of text file or into a buffer so that when I need to re-enter it, I don't have to constantly go through log files to copy the input again (I get the input from log files)?


You can pipe it to stdin of the script:

echo 2.25.9847261 | ./sendExamToRepo.sh

Or redirect stdin to come from a file:

./sendExamToRepo.sh < SUID.txt
  • Perfect, the echo statement works good enough for me!! thanks – ryekayo Sep 15 '14 at 15:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.