bash - What does < in Shell Scripts do? -


this question has answer here:

for example,

matlab -nodesktop -singlecompthread < run%d/run.m 

i know means matlab suppose use run.m file in run%d directory mean shells in general?

by itself, command < filename tells shell run named command input coming file filename, instead of terminal typed command line.

you can go other way, too, sending output of command file, command > filename.

there 2 different output streams connected terminal - normal one, called "standard output" , redirected >, , "standard error" stream, lets program tell when went wrong though normal output going file instead of terminal. if don't want see error messages, want them go terminal well, can use >& filename.

if want send errors own separate file, can use 2>*error_filename*; leaves standard output stream alone, going terminal or wherever sent > or |.

there's lot more can do, use output of 1 command file anywhere command expects filename. see the link konsolebox posted more details.


Comments

Popular posts from this blog

Issues changing the value of an element in an array in matlab -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

vb.net - Alternative to the T-SQL AS keyword -