05-22-2008
Definitely C/C++ is faster than Shell Script.
Can you explain how fread is faster because i am going to read line by line only.
Regards
Kuttalaraj
7 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have written a script which does some editing in the files, based on user input.This might not be the most elegant way of doing it and there would be many improvements needed.
Please go through it and let me know how it could be improved.
Suggestions are welcome!!
Thanks!... (2 Replies)
Discussion started by: nua7
2 Replies
2. Shell Programming and Scripting
Hi!
Thank you for the help yesterday
This is the finished product
There is one more thing I would like to do to it but I’m not to certain
On how to proceed I would like to log all output to a log in order to
Be able to roll back
This script is meant to be used in repairing a... (4 Replies)
Discussion started by: Ex-Capsa
4 Replies
3. Infrastructure Monitoring
Hello,
I am pretty new to shell scripts and I recently wrote one that seems to do what it should but I am exploring the possibility of improving its performance and would appreciate some help. Here is what it does - Its meant to monitor a bunch of systems (reads in IPs one at a time from a flat... (9 Replies)
Discussion started by: prafulnama
9 Replies
4. UNIX for Advanced & Expert Users
can anyone help to share the knowledge on linux os improvement?
1) os account
- use window AD authentication, such as ldap, but how to set /etc/passwd, where to put user home?
2) user account activity
- how to log os user activity
share the idea and what tools can do that...thx (5 Replies)
Discussion started by: goodbid
5 Replies
5. Shell Programming and Scripting
Hi All,
Here is my script
#! /bin/sh
var1=some email id
var2=some email id
grep -i "FAILED FILE FORMAT VALIDATION" /opt >tmp2
diff tmp1 tmp2 | grep ">" >tmp3
if
then
cat tmp3 | mailx -s " Error Monitoring" $var2
else
echo "Pattern NOt Found" | mailx -s " Error Monitoring" $var1... (1 Reply)
Discussion started by: Gopalak
1 Replies
6. UNIX for Dummies Questions & Answers
Hi This is my Following code:
#!/bin/sh
echo "TOTAL_NO_OF_MAILS"
read TOTAL_NO_OF_MAILS
echo "TOTAL_NO_OF_TICKETS "
read TOTAL_NO_OF_TICKETS
echo "TICKETS_IN_QUEUE"
read TICKETS_IN_QUEUE
rm -rf `pwd`/Focus
echo "Hi Team\nSTATS IN CLRS MAIL BOX\n\n==============================" >> Focus... (11 Replies)
Discussion started by: wasim999
11 Replies
7. Shell Programming and Scripting
Below script is used to search numeric data from around 400 files in a folder. I have 300 such folders. Need help in performance improvement in the script.
Below Script searches 20 such folders ( 300 files in each folder) simultaneously. This increases cpu utilization upto 90% What changes... (3 Replies)
Discussion started by: vegasluxor
3 Replies
LEARN ABOUT HPUX
pthread_rwlock_trywrlock
pthread_rwlock_wrlock(3T) pthread_rwlock_wrlock(3T)
NAME
pthread_rwlock_wrlock(), pthread_rwlock_trywrlock() - lock or attempt to lock a read-write lock for writing
SYNOPSIS
PARAMETERS
rwlock Pointer to the read-write lock to be locked for writing.
DESCRIPTION
The function applies a write lock to the read-write lock object referenced by rwlock. The calling thread acquires the write lock if no
other thread (reader or writer) holds the read-write lock rwlock. Otherwise, the thread blocks (that is, it does not return from the call)
until it can acquire the lock. Results are undefined if the calling thread holds the read-write lock (whether a read or a write lock) at
the time the call is made.
The function applies a write lock as in the function with the exception that the function fails if any thread currently holds rwlock (for
reading or writing).
Results are undefined if any of these functions are called with an uninitialized read-write lock.
If a signal is delivered to a thread waiting for a read-write lock, upon return from the signal handler, the thread shall resume waiting
for the read-write lock as if it was not interrupted.
RETURN VALUE
Upon successful completion, and return zero. Otherwise, an error number is returned to indicate the error (the variable is not set).
ERRORS
If any of the following occur, the function returns the corresponding error number:
[EBUSY] The read-write lock rwlock could not be acquired for writing because it was already locked for reading or writing.
For each of the following conditions, if the condition is detected, the and functions return the corresponding error number:
[EINVAL] The value specified by rwlock does not refer to an initialized read-write lock.
[EDEADLK] The current thread already owns the read-write lock for reading or writing.
AUTHOR
and were developed by X/Open.
SEE ALSO
pthread_rwlock_init(3T), pthread_rwlock_destroy(3T), pthread_rwlock_tryrdlock(3T), pthread_rwlock_rdlock(3T), pthread_rwlock_unlock(3T).
STANDARDS CONFORMANCE
Pthread Library pthread_rwlock_wrlock(3T)