Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: peterro
4,735
Posted By peterro
The only problem with that solution is that if...
The only problem with that solution is that if there are any log entries that are created during the application startup, they'll be lost when you copy the file back on top. You may also want to mv...
10,731
Posted By peterro
Can you change the format to simply the number of...
Can you change the format to simply the number of seconds total duration? If not, I would just convert each line to seconds and use that as to generate your average. Convert the average back to...
7,995
Posted By peterro
Expert Shell Scripting (ISBN-13: 978-1430218418)...
Expert Shell Scripting (ISBN-13: 978-1430218418) was written by an administrator as a reference for an administrator.
3,047
Posted By peterro
Do you want an xterm with a message for the...
Do you want an xterm with a message for the purpose of a message or for some other reason? If it's just for a message, you might use xmessage instead.
4,338
Posted By peterro
I would probably read each line in and convert it...
I would probably read each line in and convert it to an SQL entry and apply all those entries to the database. If you're looking for a single shell command for that, you'll probably have a hard time....
1,448
Posted By peterro
Glad you got it working. Another method would be:...
Glad you got it working. Another method would be:

grep -A 10 "interface data" your_log

This assumes the proper version of grep though.
14,136
Posted By peterro
This has worked for me but it's been a while...
This has worked for me but it's been a while since I've used it. You'll want to at least modify the To/From lines:


tmpfile=/tmp/mimetmp.$$
basefile=`basename $your_file`

cat > $tmpfile <<...
5,041
Posted By peterro
This really isn't the correct forum for your...
This really isn't the correct forum for your question. Likely there are probably errors listed prior to the 'command failed for target' message that need to be resolved.
4,865
Posted By peterro
Parse through the line and get the first:last...
Parse through the line and get the first:last values.


for i in $(eval echo "{$first..$last}")
do
echo assign etc etc $i etc etc etc $i
done
10,418
Posted By peterro
How about... #!/bin/bash ...
How about...


#!/bin/bash

username='elogic1'
domains='abcd.com efgh.com ijkl.com'
path_to_webalizer='/hsphere/shared/bin/webalizer'
path_to_logs='/hsphere/local/home/elogic1/logs/abcd.com'...
2,520
Posted By peterro
This doesn't seem to be a shell scripting...
This doesn't seem to be a shell scripting question but more of a sybase question. Wouldn't you want to ask this on a sybase forum?
5,241
Posted By peterro
I have fwtmp on my Solaris systems but it's not...
I have fwtmp on my Solaris systems but it's not on any of our Linux boxes.
2,855
Posted By peterro
Does your version of rsync have a -n switch to...
Does your version of rsync have a -n switch to perform a dry-run? From the man page:
5,241
Posted By peterro
That's pretty cool. What OS is that applicable...
That's pretty cool. What OS is that applicable to? Also, what OS is the original post using?
8,014
Posted By peterro
I suppose it depends on the cron job. Having the...
I suppose it depends on the cron job. Having the full login environment is probably convenient but is probably overkill since it likely has many pieces that are not necessary to your specific job....
8,014
Posted By peterro
You could source /etc/profile in your job or...
You could source /etc/profile in your job or script being called. The cron environment is different than an interactive shell and is much more sparse. Check out chapter 12 in Expert Shell Scripting...
5,241
Posted By peterro
Ok, I'm still sticking with this being a more...
Ok, I'm still sticking with this being a more complex problem than a single pipe-line command. If someone else has a better solution, that'd be great.

Some pseudo code:


Convert your date...
5,241
Posted By peterro
I think you're going to have a significant...
I think you're going to have a significant challenge in doing this since you'll have to determine (for each entry) whether the session time range falls within the range you would be specifying. I...
2,577
Posted By peterro
you could add set -x to the beginning...
you could add

set -x

to the beginning of your code to get some debug output. I'm not seeing anything obviously wrong with your code so more information would be needed.
15,690
Posted By peterro
What is the value of the select_return variable? ...
What is the value of the select_return variable? You also might add

set -x

to the beginning of the code to get some debug output.
1,473
Posted By peterro
DIRECTORY=`pwd` or check for the...
DIRECTORY=`pwd`

or check for the environmental variable $PWD
15,690
Posted By peterro
A general solution for calling DB queries from a...
A general solution for calling DB queries from a shell script:


SQL="select something from somewhere where some_constraints"
sqlplus username/password <<EOF
$SQL;
EOF


You could probably...
5,196
Posted By peterro
That wouldn't be part of your script environment...
That wouldn't be part of your script environment though. Are you using these aliases for something else or mainly this? You could source your .bashrc or keep the definitions in a separate file and...
5,196
Posted By peterro
Where do the aliases get defined?
Where do the aliases get defined?
3,254
Posted By peterro
instead of print $i you could echo...
instead of

print $i

you could

echo -n $i

or


for i in `lspv | awk '{print $1}`
do
attribute=`sattr -El $i | grep queue_depth | awk '{print $1 ":" $2}'`
print $i $attribute
done
Showing results 1 to 25 of 159

 

Featured Tech Videos

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