05-09-2006
re
after you get the thescript.script into 'name'. Do
fname=${name%%.script}
echo $fname --> gives 'thescript'
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello,
what I have:
---
lots of text bla bla bla
PATCH MANAGEMENT AND SOFTWARE UPDATES - EXTERNAL
Risk Severity: High Area: External Network Relative Rating: Medium
lots of text bla bla bla
WIRELESS AP
Risk Severity: High Area: External Network Relative Rating: Poor
... (3 Replies)
Discussion started by: yoyo123
3 Replies
2. Shell Programming and Scripting
As the title says, echo is striping my quotes and I need them.
echo "<?xml version="1.0" encoding="ISO-8859-1"?>"
returns:
<?xml version=1.0 encoding=ISO-8859-1?>
Obviously,
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"
returns the result I need:
<?xml version="1.0"... (3 Replies)
Discussion started by: s_becker
3 Replies
3. Shell Programming and Scripting
Hi All,
Am copying mulitple files in a directory in names File0,File1,File2 etc.
I need to print separately the PID of these copies using File names.
for((i=0;i<5;i++))
do
mypid=`ps aux | awk '/File$i/ && !/awk/ { print $2 }'`
echo PID is $mypid
done
It printed nothing. Thinking... (6 Replies)
Discussion started by: amio
6 Replies
4. Windows & DOS: Issues & Discussions
To get this:
https://www.unix.com/members/silversleevesx-albums-incidental-shot-glass-picture127-termshot-rxvt-rootless.png
out of Cygwin's rxvt, you have to tweak your
/cygwin/etc/x11/app-defaults/rxvt file, which is here:... (0 Replies)
Discussion started by: SilversleevesX
0 Replies
5. Shell Programming and Scripting
I would appreciate some help, please.
I have a file cutshellb.txt, which contains four report names (but it could be any number from 1 to x. The report suffix is not necessarily consecutive:
report3785
report3786
report3787
report3788
I have a shell script which attempts to read the... (3 Replies)
Discussion started by: Dicloflex
3 Replies
6. Shell Programming and Scripting
I have pasted the contents of a log file (swmbackup.wrkstn.1262071383.sales2a) below:
Workstation: sales2a<BR
Vault sales2a-hogwarts will be initialized.<BR
<font color="red"There was a problem mounting /mnt/sales2a/desktop$ </FONT<BR
<font color="red"There was a problem mounting... (4 Replies)
Discussion started by: bigtonydallas
4 Replies
7. Shell Programming and Scripting
I am trying to capture the process on a red hat linux system with the highest cpu utilization into a variable. I have been playing with ps command but really do not think I am making the correct progress.
For instance:
top - 09:01:16 up 63 days, 18:29, 2 users, load average: 0.39, 0.49, 0.48... (5 Replies)
Discussion started by: jaysunn
5 Replies
8. UNIX for Advanced & Expert Users
Dear Experts,
Pl help me to fix this
i am trying to unmount the all the file systems in VG, Once unmounted vary off the VG.
I have written the script to do that it works fine when none of user or process id holds it but if in use it says resource is busy and can't unmount.
even i used... (2 Replies)
Discussion started by: nmadhuhb
2 Replies
9. Shell Programming and Scripting
Hi All,
I need to get the PID of a process which i ran in background into a variable
echo $! gives me the PID of last background process but how to get this into a variable so that i can use "wait" command later in the script to make sure that this background process was done
var = `echo... (5 Replies)
Discussion started by: firestar
5 Replies
10. Shell Programming and Scripting
Have a script where I need to wait for a process to run, but from that process I want to capture the row count.
Script I have so far (easier than explanation):
echo "Start"
export NUMROWS=`td "select * from dbc.database" 2> /dev/null |
grep "Query completed" | sed -e 's/.*Query... (7 Replies)
Discussion started by: Cranie
7 Replies
catch(n) Tcl Built-In Commands catch(n)
__________________________________________________________________________________________________________________________________________________
NAME
catch - Evaluate script and trap exceptional returns
SYNOPSIS
catch script ?varName?
_________________________________________________________________
DESCRIPTION
The catch command may be used to prevent errors from aborting command interpretation. Catch calls the Tcl interpreter recursively to exe-
cute 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 one of the exceptional return codes (see tcl.h for
the definitions of code values). If the varName argument is given, then the variable it names is set to the error message from interpret-
ing script.
If script does not raise an error, catch will return 0 (TCL_OK) and set the variable to the value returned from script.
Note that catch catches all exceptions, including those generated by break and continue as well as errors. The only errors that are not
caught are syntax errors found when the script is compiled. This is because the catch command only catches errors during runtime. When
the catch statement is compiled, the script is compiled as well and any syntax errors will generate a Tcl error.
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
}
The catch command will not catch compiled syntax errors. The first time proc foo is called, the body will be compiled and a Tcl error will
be generated.
proc foo {} {
catch {expr {1 +- }}
}
KEYWORDS
catch, error
Tcl 8.0 catch(n)