solaris

How do I trap EXIT in a solaris 11 shell script?

佐手、 提交于 2020-01-17 13:15:00
问题 man signal.h indicates there's no SIGEXIT in Solaris 11. How can I trap it in my shell scripts? Or how can I simulate the old behavior of traping SIGEXT? 回答1: Why are you looking to the C API manual for a shell feature ? You definitely can trap the SIGEXIT signal under Solaris 11 shells (at least ksh93, bash and sh). $ cat /etc/release Oracle Solaris 11.1 X86 Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved. Assembled 19 September 2012 $ cat /tmp/z #!/bin/ksh trap

How to subtract or add days or months to a date on Solaris?

落花浮王杯 提交于 2020-01-17 05:19:19
问题 Linux date has the -d feature which is missing in Solaris. So how can I go about subtracting or adding days or months to a date on Solaris. 回答1: you still can do this with perl or python oneliners, e.g., substract one day from current date: $ date Thu May 14 15:31:49 MEST 2015 $ python -c "from datetime import datetime, timedelta; print (datetime.now() - timedelta(1)).strftime('%c');" Wed May 13 15:31:58 2015 回答2: What you need is GNU date for Solaris. (Linux uses GNU tools) If you are using

call system() return 256

假如想象 提交于 2020-01-17 04:36:08
问题 I want to system() to print pstack info in my application, but it failed and return 256.But I pick up these codes as below to one new main function,that's ok. why? char cmd[256] ; string pstackCmd; struct timeval tv; struct tm lt;(&tv, NULL); localtime_r(&tv.tv_sec, &lt); sprintf(cmd, "pstack `pgrep app` > pstack_%04d%02d%02d%02d%02d%02d%03d", lt.tm_year+1900, lt.tm_mon+1, lt.tm_mday, lt.tm_hour, lt.tm_min, lt.tm_sec, (int)(tv.tv_usec/1000)); pstackCmd = string(cmd); int retValue = system

Anyone installed rails 3 on solaris 10x86

风流意气都作罢 提交于 2020-01-15 06:20:28
问题 I would like an easy way of installing Rails 3 on Solaris 10 x86 server that is not attached to the internet. I can download files and burn to DVD or mem stick and install that way. Some Packages would be best as not really looking forward to compiling from source. Has anyone done this or seen any guides releating on how to do this ? I have seen an old post (2009) but that doesn't really help me. Regards Andy 回答1: Assuming you need to install all the requirements for running Ruby and RoR 3.0.

Chinese encoding issue while listing files

旧城冷巷雨未停 提交于 2020-01-15 03:05:57
问题 I am running a Java application on a Solaris10 with Chinese . Now there are some files in a directory with chinese filenames. When I do files = new File(dir).list() where "dir" is the parent directory containing that chinese file, I get the result filename files[0] as ????? (some junk characters). Now the deal is that my programs file.encoding property is already set to GBK and I also do Charset.isSupported("GBK") and it returns true too. So where could be the problem. I am running out of

Solaris and Preprocessor Macros

倖福魔咒の 提交于 2020-01-14 18:49:34
问题 Would someone post the results of cpp -dM < /dev/null from a Solaris 10 or above system? I'm having trouble locating what preprocessor macros are typically defined. Solaris documentation does not discuss it in detail [1], [2], and Google is not being very helpful. Thanks in advance. 回答1: Solaris 11.1 #define __DBL_MIN_EXP__ (-1021) #define __FLT_MIN__ 1.17549435e-38F #define __CHAR_BIT__ 8 #define __WCHAR_MAX__ 2147483647 #define __DBL_DENORM_MIN__ 4.9406564584124654e-324 #define __FLT_EVAL

Solaris and Preprocessor Macros

六月ゝ 毕业季﹏ 提交于 2020-01-14 18:48:30
问题 Would someone post the results of cpp -dM < /dev/null from a Solaris 10 or above system? I'm having trouble locating what preprocessor macros are typically defined. Solaris documentation does not discuss it in detail [1], [2], and Google is not being very helpful. Thanks in advance. 回答1: Solaris 11.1 #define __DBL_MIN_EXP__ (-1021) #define __FLT_MIN__ 1.17549435e-38F #define __CHAR_BIT__ 8 #define __WCHAR_MAX__ 2147483647 #define __DBL_DENORM_MIN__ 4.9406564584124654e-324 #define __FLT_EVAL

Python3 shebang line not working as expected

荒凉一梦 提交于 2020-01-14 12:09:40
问题 I'm having the below issue running a Python script in a Solaris environment. It appears I have done something incorrect on the shebang line, but I can't tell if this is a Python 3 issue or a command line issue. But I suspect it's related to the shebang line somehow since when I explicitly run the Python interpreter on the command line there is no problem. The path /opt/python3.3.2/bin/python3.3 is the location where my sysadmin chose to put Python, I don't know of this location is problematic

Python3 shebang line not working as expected

强颜欢笑 提交于 2020-01-14 12:07:23
问题 I'm having the below issue running a Python script in a Solaris environment. It appears I have done something incorrect on the shebang line, but I can't tell if this is a Python 3 issue or a command line issue. But I suspect it's related to the shebang line somehow since when I explicitly run the Python interpreter on the command line there is no problem. The path /opt/python3.3.2/bin/python3.3 is the location where my sysadmin chose to put Python, I don't know of this location is problematic

\377\376 Appended to file (Windows -> Unix)

不想你离开。 提交于 2020-01-11 09:58:06
问题 Morning All - I have a problem and the solution has alluded me for a few days now. I have an SSIS package that performs the following. 1. Run SQL script 2. Export results to flat file (UTF-8 Encoded, ; delimitated, and \n for new lines) 3. FTP results to solaris machine ( binary format ) The problem is, that when the file is shows up on my solaris box it has the following at the start of the file. \377\376 I have tried dos2unix and still has not corrected the issue. In fact it changes the