get

get "f" -- yields a string containing the contents of the file whose name is f.

get "!f" -- yields a string containing the output from the shell command "f".

get "$hostname:service" -- yields a string containing the input from the socket obtained by connecting to the specified host at the port appropriate for the specified service. Warning: if the process providing the service expects interaction, it will not get it, and this command will hang. This feature is not available on Sun computers, because Sun doesn't provide static versions of crucial libraries dealing with network communications.

get f -- yields a string containing the rest of the input from the file f.

i1 : "junk" << "hi there" << endl << close

o1 = --closed file--

o1 : File
i2 : get "junk"

o2 = hi there


o2 : String
i3 : get "!date"

o3 = Tue Nov 17 11:42:34 CST 1998


o3 : String

See also File, String, and read.


topindexpreviousupnext