07-28-2015
I used the sh code offered by MadeInGermany and it is working perfectly.
Many thanks!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello, I am new at this forum so please bare with me on this.
Within a given directory, I have a list of files in which in each file, I would like to do a substitution. I would like to substitute the string mlcl to mll in each file using the foreach command. I dont quite get how to do that. If... (7 Replies)
Discussion started by: clipski
7 Replies
2. Shell Programming and Scripting
What am I doing wrong with this foreach loop?
foreach var ($argv)
@sum = $sum + $var (4 Replies)
Discussion started by: haze21
4 Replies
3. Shell Programming and Scripting
Hi Guys,
I have a loop which uses a wildcard
i.e. foreach f (*)
but when I execute the tcsh file in unix then it gives me an error
->>>>>>>foreach: words not parenthesized<<<<<<<<<<-
Any help. (1 Reply)
Discussion started by: abch624
1 Replies
4. Shell Programming and Scripting
In a foreach loop, is it possible for the loop to go through 2 arguments instead of one
i.e. instead of foreach i (do stuff for i), we have foreach i j(do stuff for i; do stuff for j)
I am working under BASH and TCSH shell environments
cheers (3 Replies)
Discussion started by: JamesGoh
3 Replies
5. Shell Programming and Scripting
Hi everyone
Does anyone know what is wrong with this script. i keep getting errors
foreach filename (`cat testing1`)
set string=$filename
set depth=`echo "$string"
echo $depth
end
the error is the following
testing: line 1: syntax error near unexpected token `('
testing: line 1:... (3 Replies)
Discussion started by: ROOZ
3 Replies
6. UNIX for Advanced & Expert Users
Hi All,
Is there any problem with the below 'foreach' loop?
foreach risk_factor ($(cat "$rf_list"))
where "rf_list=$SCRIPT/Utility/rflist.txt "
I'm wondering, it is throwing below error message:
syntax error at line 34: `(' unexpected
Any idea/suggestions ?
Thanks in advance /... (7 Replies)
Discussion started by: ganapati
7 Replies
7. Shell Programming and Scripting
So I am back again beating my head against the wall with a shell script and getting a headache! I want to change each year in a file (1980, 1981, 1982, 1983, etc.) to the same year followed by a tab.
The input is "blah blah (1980) blah blah".
I want to get "blah blah (1980 ) blah blah".... (2 Replies)
Discussion started by: Peggy White
2 Replies
8. UNIX for Dummies Questions & Answers
I am trying to make a script for my Counter-Strike: Source servers. What i am wanting it to do is for it to restart each server, the only way i can think of doing this in through for each.
Years what i have at the moment.
server_start() {
START=`ps x | grep SCREEN | grep $SRV | cut -d '?' -f... (5 Replies)
Discussion started by: grahamn95
5 Replies
9. Shell Programming and Scripting
Dear all,
I wrote a script to download files and move files in directories according to their name.
Now here is the problem:
Both p101 and p360 data download successfully, but when I move them according to the year and month, only p101 data can be placed at the right location, p360,... (1 Reply)
Discussion started by: handsonzhao
1 Replies
10. UNIX for Dummies Questions & Answers
Hi everyone I'm new to unix and encountered a small problem i couldnt find out a reason why it doesn't work..please help..
in my csh script when i tried to use the foreach loop like this:
foreach x ( ls )
echo $x
end
when i tried to run it, it printed out 'ls' to the std out instead of... (3 Replies)
Discussion started by: ymc1g11
3 Replies
LEARN ABOUT OPENSOLARIS
lockstat
lockstat(7D) Devices lockstat(7D)
NAME
lockstat - DTrace kernel lock instrumentation provider
DESCRIPTION
The lockstat driver is a DTrace dynamic tracing provider that performs dynamic instrumentation for locking primitives in the Solaris ker-
nel.
The lockstat provider makes probes available that you can use to discern lock contention statistics, or to understand virtually any aspect
of locking behavior inside the operating system kernel. The lockstat(1M) command is implemented as a DTrace consumer that uses the lockstat
provider to gather raw data.
The lockstat driver is not a public interface and you access the instrumentation offered by this provider through DTrace. Refer to the
Solaris Dynamic Tracing Guide for a description of the public documented interfaces available for the DTrace facility and the probes
offered by the lockstat provider.
ATTRIBUTES
See attributes(5) for a description of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWdtrp |
+-----------------------------+-----------------------------+
|Interface Stability |Private |
+-----------------------------+-----------------------------+
SEE ALSO
dtrace(1M), lockstat(1M), attributes(5), dtrace(7D)
Solaris Dynamic Tracing Guide
SunOS 5.11 3 Sep 2003 lockstat(7D)