sunos

date: illegal option — d, Find difference between two dates

久未见 提交于 2020-01-15 03:45:48
问题 I am trying to convert timestamps read from a file from string to date format so that I can find the difference of 2 dates/timestamps. most of the threads/discussions on web show usage of date argument '-d' to convert the string to epoch or to find the difference of two timestamps Find difference between two dates in bash But it looks like my environment/OS doesn't support -d date argument. Below are the details of my env: bash --version GNU bash, version 3.2.52(1)-release (i386-pc-solaris2

JMS publish rate is slow in SunOS

旧时模样 提交于 2019-12-25 04:19:24
问题 I have a application that uses JMS as messaging system. If publisher, subscriber and weblogic server is on Linux , publish rate is good enough(>30 messages/second). But if all the three are on SunOS , publish rate comes down to 2-3 messages/second . I tried to search internet but had no luck. Is there any know issue about that? What can be the reason of this strange behavior. 回答1: I found where the issue was in logs : Unable to load performance pack. Using Java I/O instead. Please ensure that

How can I iterate over .log files, process them through awk, and replace with output files with different extensions?

妖精的绣舞 提交于 2019-12-20 06:47:17
问题 Let's say that we have multiple .log files on the prod unix machine(Sunos) in a directory: For example: ls -tlr total 0 -rw-r--r-- 1 21922 21922 0 Sep 10 13:15 file2017-01.log -rw-r--r-- 1 21922 21922 0 Sep 10 13:15 file2016-02.log -rw-r--r-- 1 21922 21922 0 Sep 10 13:15 todo2015-01.log -rw-r--r-- 1 21922 21922 0 Sep 10 13:15 fix20150223.log The purpose here is that via nawk I extract specific info from the logs( parse logs ) and "transform" them to .csv files in order to load them to ORACLE

Send the output of html file within the email body

时间秒杀一切 提交于 2019-12-14 04:18:05
问题 I have an html file under /tmp folder as chart.html file which will have the output like below image when you open that html file I have a shell script that I am using to send the chart.html file as an attachment in an email with some body message. Problem Statement:- Is is possible to send this colorful image of the html file(when you open it) within the body of an email? So that people can see this image in there email body, instead of opening the attachment file. Below is the command that

UNIX programming

和自甴很熟 提交于 2019-12-13 10:30:33
问题 Hi i want to convert UNIX date to normal date (YYYY-MM-DD) 22222,0,0,0,14387 33333,0,0,0,14170 44444,0,0,0,14244 55555,0,0,0,14190 66666,0,0,0,14528 77777,0,0,0,14200 88888,0,0,0,0 99999,0,0,0,0 here 5th column represents UNIX date i want to convert into 22222,0,0,0,2009-05-23 and similarly remaining rows can any body help me 回答1: A simple awk script ought to do it awk -F, 'BEGIN{OFS=","} { print $1,$2,$3,$4,strftime("%Y-%m-%d",$5) }' myFile.txt Cheers. EDIT: You're not using unix timestamps,

Subject Name not showing in my email using mail command

强颜欢笑 提交于 2019-12-12 19:09:41
问题 I am using mail command to send an email. It works fine. echo "Ignore this email" | mail -s "Test Data" DL-host-PD-WAS-TT_Emp@corp.host.com But the only confusion I have is, in my email I didn't get any subject and it always show as (no subject) in my email as I am also specifying subject option in the above command as -s but it is not working I guess somehow. I am running SunOS. bash-3.00$ uname -a SunOS lvsaishdc3in0001 5.10 Generic_142901-02 i86pc i386 i86pc And also I am not seeing To:

Getting the uptime of a SunOS UNIX box in seconds only

◇◆丶佛笑我妖孽 提交于 2019-12-10 13:19:24
问题 How do I determine the uptime on a SunOS UNIX box in seconds only? On Linux, I could simply cat /proc/uptime & take the first argument: cat /proc/uptime | awk '{print $1}' I'm trying to do the same on a SunOS UNIX box, but there is no /proc/uptime. There is an uptime command which presents the following output: $ uptime 12:13pm up 227 day(s), 15:14, 1 user, load average: 0.05, 0.05, 0.05 I don't really want to have to write code to convert the date into seconds only & I'm sure someone must

how to get process id attached with particular port in sunos

僤鯓⒐⒋嵵緔 提交于 2019-12-04 23:56:07
问题 I am trying to get processes attached with a port 7085 on SunOS. i tried following commands. netstat -ntlp | grep 7085 didn't return anything netstat -anop | grep 7085 tried this one also. This switches are not valid in SunOs I am getting the following output. #netstat -anop netstat: illegal option -- o usage: netstat [-anv] [-f address_family] netstat [-n] [-f address_family] [-P protocol] [-g | -p | -s [interval [count]]] netstat -m [-v] [interval [count]] netstat -i [-I interface] [-an] [

How can I iterate over .log files, process them through awk, and replace with output files with different extensions?

耗尽温柔 提交于 2019-12-02 11:35:37
Let's say that we have multiple .log files on the prod unix machine(Sunos) in a directory: For example: ls -tlr total 0 -rw-r--r-- 1 21922 21922 0 Sep 10 13:15 file2017-01.log -rw-r--r-- 1 21922 21922 0 Sep 10 13:15 file2016-02.log -rw-r--r-- 1 21922 21922 0 Sep 10 13:15 todo2015-01.log -rw-r--r-- 1 21922 21922 0 Sep 10 13:15 fix20150223.log The purpose here is that via nawk I extract specific info from the logs( parse logs ) and "transform" them to .csv files in order to load them to ORACLE tables afterwards. Although the nawk has been tested and works like a charm, how could I automate a

regex failed to match using {M,N} on SunOS

↘锁芯ラ 提交于 2019-12-02 07:11:18
问题 I have the following sample file and regular expression. testing.txt testing aa a bc de e aa ba Z testing bb testing ac my regular expression using egrep egrep '[ ]{2,}' testing.txt The above regular expression attempts to find contiguous white spaces in a line. However, the result returned is empty. the regulartion expression below works for 1 or more spaces. However that is not what I want. egrep '[ ]+' testing.txt 回答1: If your system is old, this help reference might be describing the