Need to use sed to do a string replacement.
# Comments until end of line
<span class=comment>#Comments until end of line</span>
This can be accomplished with sed by using the ‘&’ operator which pastes in the match space.
Script started on Mon 01 Aug 2011 04:47:45 PM CDT
deadlycoffee:/tmp # sed 's/^#.*.$/(&)' test | sed 's/^#$/(&)/'
this is not a comment
this isn't either
(## This is)
(# So is this.)
deadlycoffee:/tmp # exit
Script done on Mon 01 Aug 2011 04:48:52 PM CDT
In the above example, I do a much simpler replacement, but it is the same idea.
You can use this kludgey command (support actually gave it to me) to get all sorts of memory information:
# echo vmstat | kdb > vmstat_info.txt
grep for stuff like 4K to see if you have overtaxed your vio server memory.
Is it possible for a reporting solution to both ‘look’ sufficiently effective to be purchased by the average IT department and ‘be’ sufficiently effective to accomplish anything of value? This is the real question and it seems sad that solutions may have to either pick one side or the other.
This shows queries that use signifantly greater cycles (and thus are a little suspicious):
select substr(sql_text,1,90),cpu_time from v$sql order by cpu_time;
Contexts of a tiny script that you should never run:
cp $0 $$ # Make a copy of yourself
sh $$ & # Run the copy in the background
sh $0 & # Rerun a new version of yourself in the background
This will probably take over your server or at least use up all of the filesystem pointers in its filesytem. In a minute or so you would have thousands of these running and doubling each generation.
This does demonstrate an interesting version of ‘the game of life’. If the copy (cp) could be a little less reliable and the whole thing could work in a few messed up ways, this could actually evolve into some other different tiny script.
Self-reference is always fun times.
I have been playing around with some environmental elements of the shell and began mocking up completions for myself by going into a special directory that had sub-directories named what I needed for my TAB completion. It turns out that with bash it is quite a bit easier and cooler than this.
We were stumbling around trying to figure out why NIM wasn’t working when we realized that the issue was with /etc/netsvcs.conf. We needed to set: hosts=local4,bind4
This got unset because we made the mistake of using our admin sandbox as the same machine as our NIM server.