linux

How to capture the result of a system call in a shell variable?

We want to build a script that run every night (kills and restart a java process). For that we need to capture the process number (since there could be more than one java process running). The command below is basically what we will use to obtain the processes number, probably with a regexp at the end of the grep. Unless any better su...

Bash - Suppress Notice of Forked Command Being Killed

Let's suppose I have a bash script (foo.sh) that in a very simplified form, looks like the following: echo "hello" sleep 100 & ps ax | grep sleep | grep -v grep | awk '{ print $1 } ' | xargs kill -9 echo "bye" The third line imitates pkill, which I don't have by default on Mac OS X, but you can think of it as the same as pkill. Howeve...

using the passwd command from within a shell script

I'm writing a shell script to automatically add a new user and update their password. I don't know how to get passwd to read from the shell script instead of interactively prompting me for the new password. My code is below. adduser $1 passwd $1 $2 $2 ...

Doing a release cycle with a product that's delivered via RPMs

I just started working for the first time with a product that's delivered via the Linux RPM mechanism, rather than as a standalone installer, and realized that this makes the test / release cycle a bit more tricky. When I was working with installers, we would just change the build numbering in our build system to mark a build as a test ...

Attach to a processes output for viewing

How would I 'attach' a console/terminal-view to an applications output so I can see what it may be saying? How would I detach from an applications output without killing the application? Normally if you fire up a talkative application using the command line you get to see all kinds of wonderful output. However lets say I have a particu...

E Text Editor got OpenSourced!!! How to recompile for linux?

Following "Open Company" idea, E Text Editor got open sourced. E Text Editor is Win port of The programming editor for MacOS, TextMate. This is pretty nice day for OS community, not because of "E Text Editor", but coz of Open Company idea. Anyone have info on how to recompile this for linux? Text in first link states it needs ecore l...

how do you make sudo save the password?

how do you set it so that sudo doesn't prompt you for your password every time? i have root. ...

Which Linux distribution is best for developing a Mono application in a virtual machine?

I've been a Windows user since forever, and now I need Linux to create an application using Mono. Which Linux distribution is best for me? I will us it in a virtual machine. ...

On *nix is there a way to trigger a process at a future date & time?

I'm looking to allow a user to enter a date and time to send out a mass email through PHP, although I'm thinking it might be best to use a *nix command to trigger the PHP process. I'm wondering if there is a way on *nix to do this without adding a cronjob to run every 15 minutes to check if there is a mass email to be sent. It's not that...

How to transfer Eclipse workspace and project from Windows to Linux and Mac

We have a a product developed on Windows for years. The product is composed of one Eclipse workspace and about 20 projects. On Windows, we ask every developer check out projects into d:\dev\product folder, and copy a unified Workspace to d:\dev\prod_workspace. This way, whenever a new machine is set, we simply copy files to the same fold...

C nonblocking IO on Linux

How do you do nonblocking console IO on Linux/OS X in C? ...

Anyone tried to compile Intel xf86_video_intel for another OS

Has anyone tried to compile Intel xf86_video_intel for another OS. This code is written for Linux. I am wondering if there is any experience with porting the code to another operating system? The code is located at: http://intellinuxgraphics.org/documentation.html Thanks, FM ...

Why buildtools like AutoTools?

Recently, I switched my development environment to LINUX from Windows. I have only used Visual Studio so far for C++ development. So many concepts like make, autotools are new to me. I have read GNU makefile documentation and got almost an idea about it. But I am kinda confused about autotools. AFAIK, makefiles are used to make the buil...

cross platform game development what to look for?

Hello. I am going to start a game in about 3 weeks and I would really like the game to run at least on another platform (linux, MacOS) but my team thinks that's a lot of work. I am up for it but wanted to know what are the things I should watch out for that won't port to linux (apart from Windows specific APIs like DirectXsound)? I've b...

What is the best way to learn x86 assembly on a Linux platform?

I have no prior knowledge of assembly programming, and would like to learn how to code x86 assembly on a Linux platform. However, I'm having a hard time finding a good resource to teach myself with. The Art of Assembly book looks good, but it teaches HLA. I'm not interested in having to learn one way, then relearning it all over again. ...

Suggestions for porting linux application to windows

I'd like to port an application written under linux to windows. Currently I'm using Cygwin but I'm curious if there are any other options that don't force me to release my source since I'm not in the position to do so right now. Are there any other options short of having to completely re-write it or buying a license? ...

Where can I find an interrupt list for i486-linux-gnu instruction set?

I am developing a compiler for my senior project in school, and I am using AS (GNU Assembler) to assemble. All of my tests have been fairly successful, but no interrupt lists I have seen have seemed to work or match up with my test code. The relevant information for this version of AS: GNU assembler 2.17 Debian GNU/Linux Copyright 2005...

Static link of shared library function in gcc

How can I link a shared library function statically in gcc? ...

How can I open a UNC path from Linux in Java?

Are there any libraries available that will allow me to read from and write to a Windows Fileshare given a UNC path from Java on Linux. It's trivial on a windows box itself, and I'm aware of smbclient approaches, but I'm looking to do it by dropping in a library. Thanks. ...

Continual wake and sleep for minimal power usage on linux?

I'd like to use a linux pc purely to collect rss feeds, but would like to minimise it's power usage as much as possible. Presumably I would create some kind of cron job to bring it in and out of sleep mode or are there better ways of tackling this? ...