That looks almost char-for-char identical to code I wrote a few months ago. It began when simplifying their code with this:
They were thrilled they didn't have to do echo ... >> logfile and command 2>>errorlogfile every single time, but they didn't like that _LOGFILE was always created even when no errors occurred. So I added the trap to clean up the log file at exit unless it had greater-than-zero size.
Hello all,
I'm hoping to get a little insight from some of the wily veterans amongst you.
I've written a script to check for new outgoing files to our vendors located on our ssl server. It seems to be working ok, but the final question here, will be one of logic, and/or a better way to... (4 Replies)
how does below tr command replace nonletters with newlines?
I think I understand tr -cs '\n' part.. but what is
A-Za-z\' <--- what is this??
tr -cs A-Za-z\' '\n' |
-c --complement
-s, --squeeze-repeats
replace each input sequence of a repeated character that is... (0 Replies)
how does below tr command replace nonletters with newlines?
I think I understand tr -cs '\n' part.. but what is
A-Za-z\' <--- what is this??
tr -cs A-Za-z\' '\n' |
-c --complement
-s, --squeeze-repeats
replace each input sequence of a repeated character that is... (1 Reply)
Hi
Our problem is knowing:
What is the "best" way of simulating a TRAP for ERR within a function, since we know this will not work directly with ksh93 and aix5. How can we save the error encountered in the function and then deal with it in the calling script?
Thanks! (3 Replies)
Hi am having a c pgm. It has the include files (unistd.h,sys/types.h,win.h,scr.h,curses.h,stdarg.h and color.h). I don't know the purpose of these include files. will u plz explain me. (1 Reply)
I have a script
#!/bin/ksh
trap cleanup 20
cleanup()
{
cat $t.log
echo Caught
exit 1
}
if ;then
echo Found >>t.log
exit 20
else
echo Not found >>t.log
exit 20
fi (5 Replies)
Hi folks,
I have tried to add some trap detection in the below script....this script is used to monitor database activities...in a rather awkward way :rolleyes:....
The idea behind adding trap is that....this script creates lots of temporary files in the running folder to store the count... (1 Reply)
Its great someone provided this script that strips out a filename and extension but can someone explain how each line works?
file1='Jane Mid Doe.txt'
newfile='Jane.txt'
1) ext=${file1##*.}
2) filename=${file%%.???}
3) set -- $filename
4) newfile="1.$extension" (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
That is the last reply I received from my instructor, and I'm looking for some alternatives.
When using... (2 Replies)
Hi,
I need more explination on it, how it works
abcd="$(echo "$abcd" | sed 's/ //g')" >> ${LOGFILE} 2>&1
can any one suggest me on this?
Rgds,
LKR (1 Reply)
Discussion started by: lakshmanraok
1 Replies
LEARN ABOUT LINUX
cachefswssize
cachefswssize(1M) System Administration Commands cachefswssize(1M)NAME
cachefswssize - determine working set size for cachefs
SYNOPSIS
cachefswssize logfile
DESCRIPTION
The cachefswssize command displays the workspace size determined from logfile. This includes the amount of cache space needed for each
filesystem that was mounted under the cache, as well as a total.
USAGE
See largefile(5) for the description of the behavior of cachefswssize when encountering files greater than or equal to 2 Gbyte ( 2 **31
bytes).
EXAMPLES
Example 1: A sample output of cachefswssize.
example% cachefswssize /var/tmp/samlog
/home/sam
end size: 10688k
high water size: 10704k
/foo
end size: 128k
high water size: 128k
/usr/dist
end size: 1472k
high water size: 1472k
total for cache
initial size: 110960k
end size: 12288k
high water size: 12304k
EXIT STATUS
The following exit values are returned:
0 success
non-zero an error has occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO cachefslog(1M), cachefsstat(1M), cfsadmin(1M), attributes(5), largefile(5)DIAGNOSTICS
problems were encountered writing log file
There were problems encountered when the kernel was writing the logfile. The most common problem is running out of disk space.
invalid log file
The logfile is not a valid logfile or was created with a newer version of Solaris than the one where cachefswssize is running.
SunOS 5.10 16 Sep 1996 cachefswssize(1M)