solaris

How to capture running log using bash script? [Case Closed]

烂漫一生 提交于 2019-12-13 06:32:21
问题 I'm a new player in bash scripting. There's something that I want to know about capture logfile using bash script. Let's say there is a server which store logfile every hour with format file below. file[20160509_130000].log The logfile has detailed information like this. 13:00:00 INFO [file.chdev130] Event: ADIEVN_PLAY_DONE, Finished , nbytes=16360 13:00:00 INFO [file.chdev39] adiCollectDigits() success My question is how can i read and store the running log or one hour before to get specific

Awk adding constant values

时间秒杀一切 提交于 2019-12-13 05:17:22
问题 I have data in the text file like val1,val2 with multiple lines and I want to change it to 1,val1,val2,0,0,1 I tried with print statement in awk(solaris) to add constants by it didn't work. What is the correct way to do it ? (From the comments) This is what I tried awk -F, '{print "%s","1,"$1","$2"0,0,1"}' test.txt 回答1: Based on the command you posted, a little change makes it: $ awk -F, 'BEGIN{OFS=FS} {print 1,$1,$2,0,0,1}' file 1,val1,val2,0,0,1 OR using printf (I prefer print ): $ awk -F,

how to exclude snapshots while running tar in Solaris

╄→гoц情女王★ 提交于 2019-12-13 02:50:41
问题 I'm trying to take a tar of the '/home/store/' directory content. tar cvf store.tar /home/store/ While doing so, I can see that the .snapshot directories are also getting included. My understanding is that snapshots are kind of backups. Can I skip this? If possible, how? Tried excluding a test directory using the below command ran from /home/store/ tar cvfX store.tar <(echo /home/store/test) /home/store/ But this is not excluding the test directory from the tar created. Also, tried this tar

Just one source code can be used on Solaris 11 sparc and x86?

ε祈祈猫儿з 提交于 2019-12-13 02:14:32
问题 I've made some access control program with PAM, and it can be compiled on Solaris 11 sparc and x86 now. I know that the architecture is difference between sparc and x86. Would I test on each platform? or just one platform case? thank you, read it. 回答1: It is hard to tell without knowing precisely what APIs and features your program is using but assuming it compiles well in both platforms and works fine in one of them, the risk for it to fail in the other is extremely low. Solaris is built

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:

Crash caused by invalid exception unwinding?

梦想的初衷 提交于 2019-12-12 19:05:27
问题 I'm debugging a crash which occurs in one of our tests. We have an ODBC driver .so written in C++, which is being tested via iODBC using our test tool (called 'Touchstone'), which is also written in C++. I've compiled all three on Solaris 10 (x86) in 64-bit mode using the Oracle Solaris Studio 12.4 ( NOT GCC). The crash only occurs when Touchstone is built in release mode, so I've spent a fair bit of time stepping through assembly in dbx, and what seems to happen is the following: The 'this'

Can I execute a multiline command in Perl's backticks?

醉酒当歌 提交于 2019-12-12 18:35:22
问题 In Unix, I have a process that I want to run using nohup. However this process will at some point wait at a prompt where I have to enter yes or no for it to continue. So far, in Unix I have been doing the following nohup myprocess <<EOF y EOF So I start the process 'myprocess' using nohup and pipe in a file with 'y' then close the file. The lines above are effectively three seperate commands - i.e. I hit enter on the first line in UNIX, then I get a prompt where I enter 'y' and then press

On Solaris, are libraries compiled with gcc usable the same way as for libs generated with cc?

被刻印的时光 ゝ 提交于 2019-12-12 18:26:45
问题 I am currently trying to compile libxml2 on Solaris . When I run the ./configure script provided with the sources, the gcc and g++ compilers are automatically used. However, I would like to use cc and CC compilers. So I run : ./configure CC=cc CXX=CC It works but then, when I run " make ", I get some errors which prevent the libraries to be generated. When gcc and g++ are used, everything goes well with no errors, so I was wondering: can I use the librairies generated with gcc/g++ the same

Warning (Anachronism): Assigning void(*)(int) to extern “C” void(*)(int)

时光毁灭记忆、已成空白 提交于 2019-12-12 18:08:32
问题 I'm having trouble with Sun's C++ compiler. I've read Oracle's Working with Pointers to Functions [from C++]. Its a good read, and I get the impression SunCC is most compliant among all the compilers in this area (though its causing me trouble). The test code is below, and line 24 is new_handler.sa_handler = (pfn ? pfn : &SignalHandler::NullHandler); . Unrolling the ternary operator shows this is the issue: new_handler.sa_handler = pfn; . SunCC 5.11 $ /opt/solstudio12.2/bin/CC test.cxx "test

Choosing a different executable in bash

雨燕双飞 提交于 2019-12-12 16:18:46
问题 When I want to run make to generate some executables it always uses the Sun make located at /usr/local/bin/make rather than GNU make which can be found at /usr/sfw/bin/gmake . How can I tell the OS to use GNU make rather than Sun's? Do I need to overwrite the path somehow? 回答1: For two executables named identically, reorder paths in the PATH variable, since the first match will be used. Otherwise, define an alias in your ~/.profile or ~/.bashrc file: alias make="/usr/sfw/bin/gmake" Or a