Script, display contents of a file using cat
This is the script I'm working on, I'm finished except for "displaying a file using cat" I'm unsure of the "wording". I know it's
Code:
cat filename Code:
echo "Enter a filename" I'm new to all of this and still tying too figure out all the commands. I would appreciate any insight you can give me.:) Code:
#!/bin/bash |
The problem is the script asks the user to enter the file name but does not read what the user enters. The shell's read command would be useful.
|
As I assume this is homework which is to be marked, may I suggest you try entering a space separated file name for any of your examples and see how your output goes.
Also, you seem to have great trust in your user as you never check that they give you a valid file name, ie. does it exist? can you do the things you want to, to the file? Just food for thought :) |
All times are GMT -5. The time now is 06:22 AM. |