unix date, number of seconds since epoch
Is there a way to use unix date to print the number of seconds since epoch? I'm open to using other standard shell commands if there is a way (I'm using Solaris, so there isn't date "+"%s") Thanks ...
Is there a way to use unix date to print the number of seconds since epoch? I'm open to using other standard shell commands if there is a way (I'm using Solaris, so there isn't date "+"%s") Thanks ...
I have a path that is stored in a variable $FULLPATH="/this/is/the/path/to/my/file.txt" I also have another variable containing a partial path $PARTIAL="/this/is/the/" I want to remove the partial path from the full path so that I am left with: path/to/my/file.txt What's the best way to do this? ...
Our app servers (weblogic) all use log4j to log to the same file on a network share. On top of this we have all web apps in a managed server logging errors to a common error.log. I can't imagine this is a good idea but wanted to hear from some pros. I know that each web app has its own classloader, so any thread synchronization only o...
find . -type f -print prints out ./file1 ./file2 ./file3 Any way to make it print file1 file2 file3 ? ...
My problem is like this (OS is Sun Solaris): 1) At the boot time I want to start a process using a specific script. I am doing this by putting this script in /etc/init.d (and following other K and S rules) 2) The program which will be called by the script is located at $HOME/xxx/yyy location. 4) I am using 'su - {myuser} -c "{full pat...
Our ksh environment defines several functions. The names of these functions can be listed using then typeset -f ksh command (or the functions alias). Is it possible to see the definition (ie source code) for these functions? This seems like an obvious question, but I've tried all manner of parameters to typeset -f with no luck. As an...
Currently our process consists of logging into each *nix server and manually changing the password for each. My question is, what is a good way to automate this? I'm thinking of possibly a couple different ways to do this and would like input from others on what they recommend, use, etc. One way I was thinking is a text file with a lis...
If i am working on a unix machine how could i know the size of the machine whether it is 64 bit or 32 bit machine. ...
Say someone executes the following in a terminal: echo 'start working' > /etc/.example and when this is executed, the example program would "start working." On UNIX(-like) systems, how would something like that be implemented, and what is this kind of behavior called? ...
I'm trying to run a command to install bespinclient on my Windows laptop but every time I execute the command python bootstrap.py --no-site-packages, I get an error saying: ImportError: No module named simplejson I'm using Mozilla build tools to run these Linux commands. ...
C++ How to get a filename (and path) of the executing .so module in Unix? Something similar to GetModuleFileName on Windows. ...
I found this command line search and replace example: find . -type f -print0 | xargs -0 sed -i 's/find/replace/g' It worked fine except it changed the date and file ownership on EVERY file it searched through, even those that did not contain the search text. What's a better solution to this task? Thanks. ...
Why fork() before setsid() to daemonize a process ? Basically, if I want to detach a process from its controlling terminal and make it a process group leader : I use setsid(). Doing this without forking before doesn't work. Why ? Thanks :) ...
How can I start a job on a *nix system that will not exit when my session exits? ...
Hello, I'm using a linux server that display directories in a bold font, and files in a normal font. e.g. $ ls produces afile.txt afolder anotherfile.txt anotherfolder I'd like to use this feature on some other servers. How can it be done? with the .bash_profile? If anyone has other ideas on how to differentiate folders f...
I bash, how do I convert dos/windows newlines to unix? It must be non-interactive, not like starting vi and typing something in, but a command on the command line that can be put in a script file. The dos2unix and unix2dos commands are not available on the system. How do I do this with commands like sed/awk/tr? ...
I needed some help with ONC RPC programming. My task is to create a two-tier client-server architecture wherein one main server (something like a directory) keeps a track of level-two servers and acts as a lookup; the level-two servers expose some trivial functions, and finally, the clients for level-two servers. The clients ask th...
I have a html file that I want to trim. I want to remove a section from the beginning all the way to a given string, and from another string to the end. How do I do that, preferably using sed? ...
On a Solaris 5.8 machine, I have the following code: [non-working code] char *buf; char *dir; size_t psize; psize = (size_t) 1024; dir = getcwd(buf, psize); On this unix machine, the above does not work and I get a segmentation fault when trying to run the program. It only works if I declare dir before buf: [working code] char *d...
I have the following text file Eif2ak1.aSep07 Eif2ak1.aSep07 LOC100042862.aSep07-unspliced NADH5_C.0.aSep07-unspliced LOC100042862.aSep07-unspliced NADH5_C.0.aSep07-unspliced What I want to do is to remove all the text starting from period (.) to the end. But why this command doesn't do it? sed 's/\.*//g' myfile.txt What's the righ...