12-09-2001
creating a new C script
Hi AbRa...
Take a look at the following link:
www.cs.cf.ac.uk/Dave/C/CE.html
Why can't you use a text-editor?
You need an editor to write the code.
Gcc is a C/C++ compiler, which is used
to compile the code into some program.
/*ghost*/
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am trying to create a application in OSX through UNIX that will run a script to mount an image from a CD-ROM and run the application which it corresponds to, all with double clicking on a icon in OSX. Any thoughts or ideas?
-Mad (3 Replies)
Discussion started by: madknowledge
3 Replies
2. Shell Programming and Scripting
I need to automate the following process:
I have a list of ip address for printers in a file called iplist.txt, I need to take that list and run the command
snmpget -v 1 -c public ip address sysName.0
for each ip address to see if the printer is running snmp, I want to the create a file... (4 Replies)
Discussion started by: inLine6
4 Replies
3. Shell Programming and Scripting
Hi,
I need help urgently for following issue. Pls help me to resolve this issue.
I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql)
I given... (6 Replies)
Discussion started by: praka
6 Replies
4. Shell Programming and Scripting
Hi,
Can someone help me with creating a bash shell script.
I need to create a script that gets a positive number n as an argument.
The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Discussion started by: I-1
7 Replies
5. Programming
Hi everyone
I’m not a programmer and my knowledge of scripting is very poor, now I’m stock in a task at work and would really appreciate it if someone could help me out.
Here is the problem:
1. I have a file with 9 million entries that look like this :
611424167
610864581
611881523
609585386... (3 Replies)
Discussion started by: hiker1064
3 Replies
6. UNIX for Dummies Questions & Answers
Alright, well I did some more research since I originally posted this thread, and as much as I'd like to delete it, I can't, so I'll just extend my initial question a little.
Right now I have 3 scripts:
1#!/bin/bash
# script1 - Write all files modfied x days ago
find .. -daystart -mtime 0... (2 Replies)
Discussion started by: Aussiemick
2 Replies
7. Shell Programming and Scripting
Hi all
i am struggling in creating a restore of env files while doing applications clone.
the first file i created for copying the important configurations file
which is running perfect
now for reverting the changes i mean when i am restoring these files to its original places
i have to do... (7 Replies)
Discussion started by: javeedkaleem
7 Replies
8. Shell Programming and Scripting
Hi all,
I have a PLSQL script which has a IN list where it takes some ids as input. For example
SELECT * FROM EMPLOYEE WHERE EMPLOYEE_ID IN (comma separated list )
I want to run this quest inside a shell script but I would like to prepare the IN list dynamically where the employee ids... (1 Reply)
Discussion started by: LoneRanger
1 Replies
9. Shell Programming and Scripting
Hi everyone,
I am completely new to this forum and I have some questions regarding a script I am writing. I would be happy if anyone could help me with the small and precise script which should include if, then, else, while until, case and select.
The scenario is as follows:
1) A user... (3 Replies)
Discussion started by: codenotfound
3 Replies
10. UNIX for Advanced & Expert Users
Hi,
I have created customized scripts to start httpd and postgres (For CentOS 6) in /etc/init.d. However for it to work even after reboot, I have to put the script in /etc/rc.d/rc0.d, rc1.d, etc.
# ls -lrt
total 60
-rwxr-xr-x 1 root root 20199 Oct 4 2017 rc.sysinit
-rwxr-xr-x 1... (6 Replies)
Discussion started by: anaigini45
6 Replies
catch(n) Tcl Built-In Commands catch(n)
__________________________________________________________________________________________________________________________________________________
NAME
catch - Evaluate script and trap exceptional returns
SYNOPSIS
catch script ?resultVarName? ?optionsVarName?
_________________________________________________________________
DESCRIPTION
The catch command may be used to prevent errors from aborting command interpretation. The catch command calls the Tcl interpreter recur-
sively to execute script, and always returns without raising an error, regardless of any errors that might occur while executing script.
If script raises an error, catch will return a non-zero integer value corresponding to the exceptional return code returned by evaluation
of script. Tcl defines the normal return code from script evaluation to be zero (0), or TCL_OK. Tcl also defines four exceptional return
codes: 1 (TCL_ERROR), 2 (TCL_RETURN), 3 (TCL_BREAK), and 4 (TCL_CONTINUE). Errors during evaluation of a script are indicated by a return
code of TCL_ERROR. The other exceptional return codes are returned by the return, break, and continue commands and in other special situa-
tions as documented. Tcl packages can define new commands that return other integer values as return codes as well, and scripts that make
use of the return -code command can also have return codes other than the five defined by Tcl.
If the resultVarName argument is given, then the variable it names is set to the result of the script evaluation. When the return code
from the script is 1 (TCL_ERROR), the value stored in resultVarName is an error message. When the return code from the script is 0
(TCL_OK), the value stored in resultVarName is the value returned from script.
If the optionsVarName argument is given, then the variable it names is set to a dictionary of return options returned by evaluation of |
script. Tcl specifies two entries that are always defined in the dictionary: -code and -level. When the return code from evaluation of |
script is not TCL_RETURN, the value of the -level entry will be 0, and the value of the -code entry will be the same as the return code. |
Only when the return code is TCL_RETURN will the values of the -level and -code entries be something else, as further described in the doc- |
umentation for the return command. |
When the return code from evaluation of script is TCL_ERROR, three additional entries are defined in the dictionary of return options |
stored in optionsVarName: -errorinfo, -errorcode, and -errorline. The value of the -errorinfo entry is a formatted stack trace containing |
more information about the context in which the error happened. The formatted stack trace is meant to be read by a person. The value of |
the -errorcode entry is additional information about the error stored as a list. The -errorcode value is meant to be further processed by |
programs, and may not be particularly readable by people. The value of the -errorline entry is an integer indicating which line of script |
was being evaluated when the error occurred. The values of the -errorinfo and -errorcode entries of the most recent error are also avail- |
able as values of the global variables ::errorInfo and ::errorCode respectively. |
Tcl packages may provide commands that set other entries in the dictionary of return options, and the return command may be used by scripts |
to set return options in addition to those defined above.
EXAMPLES
The catch command may be used in an if to branch based on the success of a script.
if { [catch {open $someFile w} fid] } {
puts stderr "Could not open $someFile for writing
$fid"
exit 1
}
There are more complex examples of catch usage in the documentation for the return command.
SEE ALSO
break(n), continue(n), dict(n), error(n), return(n), tclvars(n)
KEYWORDS
catch, error
Tcl 8.5 catch(n)