Tolgar
asked on
How to get a prompt from a shell script?
Hi,
Let's say I have very basic tcsh file.
and it has something like
Now every time I run this file, I want it to ask me X then print it as the following:
How can I do that?
Thanks,
Let's say I have very basic tcsh file.
and it has something like
echo This is for file X
Now every time I run this file, I want it to ask me X then print it as the following:
>> ./example.csh
>> Which file:
>> MyFile
>> This is for file MyFile
How can I do that?
Thanks,
ASKER
Hi,
Thank you for your reply.
What kind of error checking can be added to this code?
Thanks,
Thank you for your reply.
What kind of error checking can be added to this code?
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for prompt reply.
Open in new window
The "echo -n" sends the prompt without a newline and the "$<" reads from standard input.