Search Results

Search: Posts Made By: Smiling Dragon
11,020
Posted By Smiling Dragon
I think this is a fair question, although I risk...
I think this is a fair question, although I risk taking us a long way off topic here ;)

The thing to remember is that most Unix is still not Linux and that many Unixes that are not Linux do not...
7,675
Posted By Smiling Dragon
Hi there, you'll want something like this: ...
Hi there,

you'll want something like this:
while true
do
if [ -s "rep_exception.log]
then
mail -s "Exception found for replication on `hostname`" $targetemailaddress <...
3,485
Posted By Smiling Dragon
At a (very) high level, you want: while true ...
At a (very) high level, you want:
while true
do
for processname in $ListOfProcessesToLookFor
do
if processnotrunning $processname
then
echo "Oh dear! The process...
10,862
Posted By Smiling Dragon
#!/bin/sh while read line do ...
#!/bin/sh
while read line
do
firstword=`echo "$line" | awk '{ print $1 }'`
if egrep "^$firstword\$" filterfile.txt
then
echo "$line"
fi
done
Depending on your OS, you might need...
42,736
Posted By Smiling Dragon
You are *really* close: #!/bin/csh set...
You are *really* close:
#!/bin/csh
set dirs=`*/*/*/*/`
foreach dir ($dirs)
cd $dir
/scratch/scratchdirs/sol/Scripts/QMcalc/GEN_POSCAR
end
1,493
Posted By Smiling Dragon
Try this: rsync -ravz -e ssh */00...
Try this:
rsync -ravz -e ssh */00 remote_host:/tmp
3,579
Posted By Smiling Dragon
It'll depend on which output stream the errors...
It'll depend on which output stream the errors appear on, but speaking generally, you can capture the output and/or errors as follows:
#!/bin/sh
srvctl relocate service -d $database -s $service -i...
2,873
Posted By Smiling Dragon
The s indicates you have x set but also...
The s indicates you have x set but also setuid/setgid.
You can explicitly set it to what you want with either:
chmod 0755 oracle
orchmod u=rwx,go=rx oracle

But you could also just remove the...
20,869
Posted By Smiling Dragon
Weeeellll, with a bit of bodging you can sort of...
Weeeellll, with a bit of bodging you can sort of do this.
Tar allows you to operate on an incoming stream (it was originally designed for this) and stop when you've got all you want. You still need...
1,950
Posted By Smiling Dragon
Set a flag at the start, use a while loop based...
Set a flag at the start, use a while loop based on it, unset it once you are happy all is well.

my $redo=1;
while ($redo) {

<ask your questions>

print "Are these statements correct y or...
Forum: Infrastructure Monitoring 08-08-2013
12,893
Posted By Smiling Dragon
"Load average" in top is actually the run queue...
"Load average" in top is actually the run queue average length.
Over 1 means on average things are waiting on the cpu, below 1 means on average no-one has to wait. Don't confuse this with %cpu -...
8,343
Posted By Smiling Dragon
If we're being picky (and I do love to be picky),...
If we're being picky (and I do love to be picky), you should add the sticky, setuid, and setgid flags too.
Resulting in:
^[-r][-w][-xXs][-r][-w][-xXs][-r][-w][-xXt]$
(The capital letter X is where...
Forum: Hardware 03-02-2013
3,581
Posted By Smiling Dragon
[solved] Sun Netra X1 - Adding a Second Hard Drive
As the title suggests, I'm trying to install a second drive (really want an OS mirror) on a Sun Netra X1.

I've taken the spacer out, and had a go at with the drill-press so now I have a nice HDD...
4,164
Posted By Smiling Dragon
I wonder if simply running: find . -name...
I wonder if simply running:
find . -name "output.csv" | while read filename
do
cp "$filename" `echo "$filename" | sed 's#/#-#g'`
done
Might do the trick...
It'll put ".-" in front of each one...
Forum: Solaris 01-04-2013
1,671
Posted By Smiling Dragon
Solaris doesn't do much, but sendmail comes...
Solaris doesn't do much, but sendmail comes standard, if you are using sendmail then:
/etc/mail/aliases (as you found)
$HOME/.forward
$HOME/.procmailrc
/etc/.procmailrc
find / -type f -name...
2,320
Posted By Smiling Dragon
This +1 - It looks like sudo is exactly what you...
This +1 - It looks like sudo is exactly what you need for this task.

But an alternative might be to dabble with setuid instead. Extremely bad idea to do this with scripts as you can trick the OS...
4,348
Posted By Smiling Dragon
If I'm reading that correctly, the first entry...
If I'm reading that correctly, the first entry has a tab or a bunch of spaces after a newline in the name (!?!?). Or your copy-paste went a bit wrong :)

My prefered method of getting to the...
3,990
Posted By Smiling Dragon
for file in $listOfNfiles do tail +2 $file...
for file in $listOfNfiles
do
tail +2 $file >> outputfile
done


This will create "outputfile" containing everything from line 2 onwards from each of your files.
4,157
Posted By Smiling Dragon
If it doesn't have to be awk, then this would...
If it doesn't have to be awk, then this would probably do the job:

#!/bin/sh
while read file1line
do
value=`echo "$file1line" | cut -d ' ' -f 1`
user=`echo "$file1line" | cut -d ' ' -f 2`...
3,051
Posted By Smiling Dragon
Perhaps start by checking that works when you do...
Perhaps start by checking that works when you do it via a telnet localhost 25 and/or running sendmail direct form the commandline.
Also, check the system mail logs to see if the message is getting...
Forum: Solaris 07-17-2011
1,435
Posted By Smiling Dragon
Your comment about the Live cd worries me a bit,...
Your comment about the Live cd worries me a bit, normally that phrase means it's not an install but just a copy of the OS on DVD that you can boot on any computer, then when finished just eject and...
Forum: Solaris 07-17-2011
8,789
Posted By Smiling Dragon
Well the telnet one I gave above (the single...
Well the telnet one I gave above (the single line) should work as-is:
echo "b" | telnet -e "b" $i $port
Where $i is you target host/ip and $port is the port number you need to try.

The echo "b"...
3,748
Posted By Smiling Dragon
You've put single quotes round the 'sh...
You've put single quotes round the 'sh $thisScript' part, that prevents the variable ($thisScript) from being replaced with the contents. You be actually running "$thisScript" instead of the name of...
36,700
Posted By Smiling Dragon
I'd think you want 'u' (update existing) instead...
I'd think you want 'u' (update existing) instead of 'c' (create new) in your flags for tar.

As a little aside, you may also want to drop the z flag and pass the tar through a compression program...
164,347
Posted By Smiling Dragon
Sorry no, you need to use the unzip command...
Sorry no, you need to use the unzip command (pkunzip should work too).
zip files are a combination of a file globbing and compression (like a tar and gzip combined), gzip files only ever contain one...
Showing results 1 to 25 of 26

 
All times are GMT -4. The time now is 07:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy