LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   < thingy (http://www.linuxquestions.org/questions/linux-newbie-8/thingy-36711/)

nero64 11-28-2002 07:17 AM

< thingy
 
I know what > and >> do but can somebody tell me what < does and give me an example.

0x0001 11-28-2002 07:39 AM

files used with < are called here files, < redirects standard input to the command.
e.g.:
here.txt contains
ls -1
echo "----------------"
df -h
echo "----------------"
exit

try sh < here.txt

the lines in here.txt will be used in sh as if a user where entering them.

as such herefiles are the complement to > which redirect standard output.


All times are GMT -5. The time now is 08:16 AM.