I have created a script that allows the user to select a file by copying and pasting that file. Then perform a grep on that file. I want to know is it possible to put a number in front of each files in the directory so the user will only have to type a number.
What I have tried:
- Do
ls -lthenls | wc -lthen have the user select the corresponding file number, no luck. - Next,
ls -i, tried to perform a grep using the node number for that file, no luck.
lsoutput - know the dangers before attempting to rely on it. – jw013 Aug 1 '12 at 14:32