I have a small script I am working on where I need to read in a few Strings:#!/bin/bashecho Enter SUID: read $uidecho Enter Tag Number: read $dicomTagdicomDump() {        arg1=$1        cd ~/export/$1        dcmdump *.dcm > dcmResults.txt}tagFinder() {        arg1=$1        arg2=$2        for i in $(cat ~/export/$1/dcmResults.txt); do grep $2 | >> tagResults.txt        breakdone;}dicomDump $uid#tagFinder $uid $dicomTagFirst thing I notice is that in dicomDump() function, it does not change directories. When I stuck ls in the code it was still in the pwd, another thing I notice is that I am attempting to use dcmdump (which is symlinked to a program in my server with * being a wildcard). Everytime I run the script I get:E: dcmdump: No such file or directory: reading file: *.dcmCan anyone tell me why the script does not change directories as it should and how can I get it to run the dcmdump program?
Bash Script Not changing Directory
shell script
You're using read wrong.echo Enter SUID: read $uidecho Enter Tag Number: read $dicomTagshould beecho Enter SUID: read uidecho Enter Tag Number: read dicomTagAs it is, you're calling read with the argument $uid, which expands the variable uid to the empty string (since it hasn't been set), and then the shell drops the word from the argument list for read since it's empty and not quoted.  That's causing you to call the form of read where a variable name isn't given, and the response is stored in $REPLY instead.