shell

How do I capture all of my compiler's output to a file?

Hello, I'm building an opensource project from source (CPP) in Linux. This is the order: $CFLAGS="-g Wall" CXXFLAGS="-g Wall" ../trunk/configure --prefix=/somepath/ --host=i386-pc --target=i386-pc $make While compiling I'm getting lot of compiler warnings. I want to start fixing them. My question is how to capture all the compiler o...

Windows 7 Animation mouse drag event

Is there a way to have custom animation replace the defauly windows animation when you drag a window to the edge of the screen? ...

PySerial App runs in shell, by not py script

I have a very simple python script that uses pySerial to send data over the serial port to my arduino. When I execute this line-by-line in the python shell, it works just fine, but when I put it in a ".py" file, and try to run it, nothing happens. Though the Serial lights on my UART do flash. So something is getting through, but it's ...

Explain the deviousness of the Perl "preamble"

The Perl manual describes a totally devious construct that will work under any of csh, sh, or Perl, such as the following: eval '(exit $?0)' && eval 'exec perl -wS $0 ${1+"$@"}' & eval 'exec /usr/bin/perl -wS $0 $argv:q' if $running_under_some_shell; Devious indeed... can someone please explain in detail how this works? ...

Creating feed files by writing unix shell scripts.

Hi, I don't know how to create a text feed files using UNIX shell scripts? Can you please give me the sample for the same. ...

sorting group of lines

I have a text file like below iv_destination_code_10 TAP310_mapping_RATERUSG_iv_destination_code_10 RATERUSG.iv_destination_code_10 = WORK.maf_feature_info[53,6] iv_destination_code_2 TAP310_mapping_RATERUSG_iv_destination_code_2 RATERUSG.iv_destination_code_2 = WORK.maf_feature_info[1,6] iv_destination_code_3 TAP310_mapping_RATERUSG_iv...

ampersand at beginning of a line in csh

What does an ampersand at the beginning of a line do in csh? It seems to be ignored (with no error message), but why? ...

how to assign the output of a shell command to a variable ?

Hello, I have a problem putting the content of pwd command into a shell variable that i'll use later. Here is my shell code (the loop doesn't stop): #!/bin/bash pwd= `pwd` until [ $pwd = "/" ] do echo $pwd ls && cd .. && ls $pwd= `pwd` done Could you spot my mistake please? Thanks a lot for your help...

Perforce: 'remove from workspace' from command line ?

The p4v Perforce GUI client has an 'Actions > Remove from Workspace' menu command which removes all files from the workspace that are under version control and were not opened for edit or delete. This functionality only seems to be available from the GUI client, I can't find any corresponding command in the ever growing list shown by p4...

shell: return values of test on file/directory

I'm not able to check the return values of the function test; man test didn't help me much. #!/bin/bash test=$(test -d $1) if [ $test -eq 1 ] then echo "the file exists and is a directory" elif [ $test -eq 0 ] echo "file does not exist or is not a directory" else echo "error" fi ...

How do you force a java swt program to "move itself to the foreground"?

Currently with swt, I sometimes want a program to arbitrarily come to the foreground (like an alarm clock might). Typically the following works (jruby): @shell.setMinimized(false) @shell.forceActive This brings the shell to the front if it was minimized. Creating a new shell at any time also brings the (new shell) to the front. So ...

how to bind a app to a user when it connect the server with a terminal

Hi, My app now has been sealed as a product, which will be sold with a PC with linux system installed. How ever I will create a new user for the customers, but I want bind a interface-like app to the user, so when my custumers log in via terminals the selected app runs automatically, when connection ends, the app quit the same way. I kno...

I want to compare * as a literal by passin g it as command line argument

I am exceuting a shell script from windows machine through plink. I want to compare the "*" (passed as command line argument) to a literal in my script. Can anyone suggest me the way to compare * as a literal?. I have tried with all possible ways like including $1 in double quotes, single quotes, []. ...

Unix ksh loop and put the result into variable

Hi. I have a simple thing to do, but I'm novice in UNIX. So, I have a file and on each line I have an ID. I need to go through the file and put all ID's into one variable. I've tried something like in Java but does not work. for variable in `cat myFile.txt` do param=`echo "${param} ${variable}"` done It does not seems to add al...

Regarding shell script -env variables

Have a shell script that reads the files in a particular directory. #!/bin/bash for fspec in /exp/dira/test/ready/* ; do done I want to modify the unix shell script so that path is retreived from enviornmental variable. export CUST_DATA=${_FX_DATA_}/test have set this variable in environment thru .profile #!/bin/bash READY_FIL...

Status bar in bash

Hello, Firstly, Thanks everyone for all your help. I can see the successful completion of my project in couple of days.. I need to know how to put a status bar in Shell Script, something like this. No_of_files=55 index=0 while [ $index -lt $No_of_files ] do echo -en "$index of $No_of_Files Completed" index=$((index + 1)) do...

Check for stdout or stderr

Hello folks, One of the binaries which I am using in my shell script is causing a segmentation fault (RETURN VALUE: 139) And even though, I am redirecting both stdout and stderr to a logfile, the Segmentation Fault error messages is displayed in the terminal when I am running the shell script. Is it possible to redirect this message ...

bash command to repeatedly emulate keypress on a proceess

The nmap tool has such a feature - when you're performing a scan [#nmap -A -T4 localhost] and press "Enter" - it displays kind of status information "Timing: About 6.17% done" Question - how can I force this keypress to happen repeatedly without touching a keyboard in bourne shell? ps: just trying to find a work-around for a bug in php...

While loop never ends

I'm working with bash and I'm trying to do something like this: A=1 while [ $A=1 ]; do read line echo $line | grep test >/dev/null A=$? echo $A done This script never ends even when the grep finishes successfully and A is set to 0. What am I missing here? Below is a sample of the output. $ ./test.sh asdf 1 te...

How do I write a pidfile in a windows batch file

Hi! I am writing some Java code that needs to be able to write a pidfile on Unix-like as well as windows machines. On the unix machines I write out a bash shell script that contains something like this command 1>/dev/null 2>&1 & echo $! > pidfile It executes a command, redirects all output into nirwana and puts command into the backg...