Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: Smiling Dragon
6,760
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...
3,850
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 <...
1,684
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...
5,697
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...
32,774
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
871
Posted By Smiling Dragon
Try this: rsync -ravz -e ssh */00...
Try this:
rsync -ravz -e ssh */00 remote_host:/tmp
1,849
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...
1,928
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...
16,364
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,224
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
9,671
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 -...
5,651
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
2,014
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...
2,496
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,133
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...
1,857
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...
3,215
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...
1,241
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.
1,813
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`...
1,871
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,084
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
7,414
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,326
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...
30,689
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...
139,392
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

 

Featured Tech Videos

All times are GMT -4. The time now is 06:35 AM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy