{"id":6355,"date":"2022-12-20T18:58:12","date_gmt":"2022-12-20T21:58:12","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/source-mann\/"},"modified":"2022-12-20T18:58:12","modified_gmt":"2022-12-20T21:58:12","slug":"source-mann","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/source-mann\/","title":{"rendered":"source (mann)"},"content":{"rendered":"<h1 align=\"center\">source<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#EXAMPLE\">EXAMPLE<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#KEYWORDS\">KEYWORDS<\/a> <\/p>\n<hr>\n<p>______________________________________________________________________________<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">source \u2212 Evaluate a file or resource as a Tcl script<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>source<\/b> <i>fileName<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>source \u2212encoding<\/b> <i>encodingName fileName<\/i> ______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This command takes the contents of the specified file or resource and passes it to the Tcl interpreter as a text script. The return value from <b>source<\/b> is the return value of the last command executed in the script. If an error occurs in evaluating the contents of the script then the <b>source<\/b> command will return that error. If a <b>return<\/b> command is invoked from within the script then the remainder of the file will be skipped and the <b>source<\/b> command will return normally with the result from the <b>return<\/b> command.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The end-of-file character for files is \u201c32\u201d (^Z) for all platforms. The source command will read files up to this character. This restriction does not exist for the <b>read<\/b> or <b>gets<\/b> commands, allowing for files containing code and data segments (scripted documents). If you require a \u201c^Z\u201d in code for string comparison, you can use \u201c\u000032\u201d or \u201cu001a\u201d, which will be safely substituted by the Tcl interpreter into \u201c^Z\u201d.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A leading BOM (Byte order mark) contained in the file is ignored for unicode encodings (utf-8, unicode).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <b>\u2212encoding<\/b> option is used to specify the encoding of the data stored in <i>fileName<\/i>. When the <b>\u2212encoding<\/b> option is omitted, the system encoding is assumed.<\/p>\n<h2>EXAMPLE <a name=\"EXAMPLE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Run the script in the file <b>foo.tcl<\/b> and then the script in the file <b>bar.tcl<\/b>:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\"><b>source<\/b> foo.tcl <b><br \/> source<\/b> bar.tcl<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Alternatively:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">foreach scriptFile {foo.tcl bar.tcl} { <b><br \/> source<\/b> $scriptFile <br \/> }<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">file(n), cd(n), encoding(n), info(n)<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">file, script<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  source \u2212 Evaluate a file or resource as a Tcl script <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3783,1],"tags":[2635,2939],"class_list":["post-6355","post","type-post","status-publish","format-standard","hentry","category-n-comandos-tcl-tk","category-sin-categoria","tag-mann","tag-source"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6355","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6355"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6355\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6355"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6355"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6355"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}