solaris

Mysterious type conversion warning when using sys/socket.h macro

半城伤御伤魂 提交于 2019-12-04 04:26:00
问题 I'm trying to resolve conversion warnings in our C code base on Solaris 11 64-bit using GCC 9.1 (iso9899:1999) and GNU make 4.2, and I came across this one: warning: unsigned conversion from ‘int’ to ‘long unsigned int’ changes value from ‘-8’ to ‘18446744073709551608’ [-Wsign-conversion] 187 | char ccmsg[CMSG_SPACE(sizeof(int))]; | ^~~~~~~~~~ I know that CMSG_SPACE is defined in sys/socket.h as: /* Amount of space + padding needed for a message of length l */ #define CMSG_SPACE(l) \ (

How do I modify my user PROFILE file to append a scripts folder i created to the end of my PATH variable?

纵然是瞬间 提交于 2019-12-04 03:54:34
How do I modify my user PROFILE file to append a scripts folder i created to the end of my PATH variable? I am not totally sure what this means. Can anyone explain. Thanks :) Art Swri In unix/linux systems, you have a user id ('john') and a home directory ('/home/john'). The home directory has an abbreviation, the tilde: ~ (at the start of a directory path) means the same as your home directory ("/home/john"). In the home directory are several files that begin with a period (aka dot files because they start with a dot, i.e., a period). When you log in, the shell (i.e., the program that

在Solaris上编译安装Node.js

独自空忆成欢 提交于 2019-12-03 23:27:59
在写这篇文章之前,先发个感叹:我就从来没有顺顺利利的在Solaris上面装过软件。总是会遇到各种各样奇怪的问题。迄今为止最顺利的安装是Redis:没有任何的依赖,下载解压,直接make就过了。 好了,感叹完了。说说今天的安装过程。 下载了Node.js 0.4.11, Python2.7.2 操作系统SunOS 5.10 i86pc i386 i86pc Solaris 在安装之前,说一个最重要的步骤:我的Solaris环境下面每次使用gcc或者g++的时候,我都会export LD_LIBRARY_PATH=/usr/local/lib 一般情况下这样就够了。可是这次在编译Node.js的时候让我吃了很大的苦头。后来才知道在Solaris上面不应该再用LD_LIBRARY_PATH来管理共享库,应该用crle -u -l /your_shared_lib. 这样就一劳永逸的解决了共享库的环境变量问题。这次的安装成功就靠这一个命令了。 第一步先安装Python: 这一步没有碰到什么问题。 crle -u -l /usr/local/lib ./configure make 第二步安装Node.js crle -u -l /usr/sfw/lib (我的Solaris这个目录下面安装了libssl.so 所以需要把该目录环境变量里面来) ./configure make

YYYYMMDDHH date manipulation in shell script in Unix [duplicate]

亡梦爱人 提交于 2019-12-03 18:16:20
问题 This question already has an answer here : equivalent date from GNU to solaris (1 answer) Closed 5 years ago . I have a date in format "YYYYMMDDHH" and I want to add or subtract hours from it. The GNU date (date -d option) works like a charm in Linux but cant do this in non-GNU env like Solaris. Can someone please help me in how I can do this? 回答1: You should check if gdate is not already installed under your release of Solaris (might be in /usr/gnu/bin/date , /usr/sfw/bin/[g]date , /usr

How to exclude a list of full directory paths in find command on Solaris

爷,独闯天下 提交于 2019-12-03 16:19:37
I have a very specific need to find unowned files and directories in Solaris using a script, and need to be able to exclude full directory paths from the find because they contain potentially thousands of unowned files (and it's normal because they are files hosted on other servers). I don't even want find to search in those directories as it will hang the server (cpu spiking to 99% for a long time), therefore piping the find results in egrep to filter out those directories is not an option. I know I can do this to exclude one of more directories by name: find / -mount -local \( -type d -a \(

Hide symbol(s) in Shared Object from LD

会有一股神秘感。 提交于 2019-12-03 12:47:13
I have two third-party libraries occasionally having the same symbol name exported. When the executable is loaded, ld usually picks the wrong one and I getting crash as a result. I cannot do too much about the content of these libraries, so may be there is a way to instruct ld how to find the proper imlementation ? OS - Solaris 10, my program is built by autoconf/autotools/gcc, conflicting libraries are libclntsh (part of Oracle driver) and OpenLDAP. Unfortuinately, I cannot use Oracle's implementation of LDAP client - it lacks many features OpenLDAP has. Edited: The linkage is as following:

What is a reliable way of getting allowed locale names in R?

大憨熊 提交于 2019-12-03 10:54:43
I'm trying to find a reliable way of finding locale codes to pass to Sys.setlocale . The ?Sys.setlocale help page just states that the allowed values are OS dependent, and gives these examples: Sys.setlocale("LC_TIME", "de") # Solaris: details are OS-dependent Sys.setlocale("LC_TIME", "de_DE.utf8") # Modern Linux etc. Sys.setlocale("LC_TIME", "de_DE.UTF-8") # ditto Sys.setlocale("LC_TIME", "de_DE") # Mac OS X, in UTF-8 Sys.setlocale("LC_TIME", "German") # Windows Under Linux, the possibilities can be retrieved using locales <- system("locale -a", intern = TRUE) ## [1] "C" "C.utf8" "POSIX" ##

gcc: undefined reference to _mcount (gprof instrumentation)

*爱你&永不变心* 提交于 2019-12-03 10:19:35
When compiling my c++ sources with the -pg option to inject gprof profile instrumentation code the compile fails with the undefined reference to _mcount error. Without this option everything compiles (and runs) fine. What is wrong in my case? (Solaris 10 SPARC Platform) Are you both compiling each object file and linking the final executable using the '-pg' flag? 来源: https://stackoverflow.com/questions/4603298/gcc-undefined-reference-to-mcount-gprof-instrumentation

Check a files Modified date and email if it has changed [closed]

痴心易碎 提交于 2019-12-03 09:56:22
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am look for a bash script that will check if a file has been modified in the last hour and email an alert if it has been modified. This script will be used in Solaris and Ubuntu. I am sure it's not hard, but I am not a Linux admin. Can someone please help? 回答1: How about this? #!/bin/bash [[ -z `find /home

How to expand shell variables in a text file?

血红的双手。 提交于 2019-12-03 09:50:16
问题 Consider a ASCII text file (lets say it contains code of a non-shell scripting language): Text_File.msh: spool on to '$LOG_FILE_PATH/logfile.log'; login 'username' 'password'; .... Now if this were a shell script I could run it as $ sh Text_File.msh and the shell would automatically expand the variables. What I want to do is have shell expand these variables and then create a new file as Text_File_expanded.msh as follows: Text_File_expanded.msh: spool on to '/expanded/path/of/the/log/file/..