shell

Setting form as back-most. A form that always stays in background - vb6

Hi! Is there a way to set a form as back-most (form wich always stays in the back no matter what you click on the form) I am writting a shell replacemement and just using topmost on every window I start really messes some things up for some applications. Thanks! ...

su and sudo in a shell script

There is a shell script (/bin/sh, not bash) that requires root permissions for execution. If it is ran by a normal user it should ask user a password to get root access and re-run itself. Now it uses the following code: if [ $(id -u) -ne 0 ]; then su root -- $0 $@ ; ... fi That works fine, but there are some OS like Ubuntu that has n...

Check whether a certain file type/extension exists in directory

How would you go about telling whether files of a specific extension are present in a directory, with bash? Something like if [ -e *.flac ]; then echo true; fi Thanks ...

reformat java code

Hi again! I was working with a project that was saved in linux I opened it in a windows IDE and the strange thing is that it inserted break lines in all .java .jsp and other text files I like to remove all those empty lines recursively at the root directory of the project. Does anybody have some shell script that can I run to change th...

How do I see see version of tcsh that is running?

How do I see the current version of tcsh is running in my unix terminal? ...

how to avoid shell expansion when running Java app in eclipse

I am running into a peculiar behavior of the eclipse run configuration, and it appears to be a Windows-only problem. Suppose I have a Java app that prints out the command line arguments, like the following: public class WildCard { public static void main(String[] args) { for (String arg: args) { System.out.printl...

Read contents of a pdf file

Is there a commandline tool to read a pdf file on linux.Please indicate the appropriate urls for this. Thanks.. ...

zsh give file argument without creating a file - syntax?

Suppose I have have a program P which has a filename as argument. For example P file reads the file "file" and does something with it. Now sometimes the content of "file" is very small, e.g. just one line. So instead of creating a file f with that line and calling P f I want to give the content of line directly as an argument t...

global variable but still can't acess in linux

Hi, i have trying to use some global variable in my ant file. when i do login through terminal. i can acess those variable like JAVA_HOME but when i am trying to acess variable through the ant command i am not able to find them. global variable declared in .cshrc setenv JAVA_HOME jdk_full_path ant code using variable. <property...

command not found error message after I try to run a UNIX script.

I'm learning how to make shell scripts in UNIX, but I keep coming across this stupid error. Let's say I make a script like this: #!/bin/sh echo HELLO I save the file as test, and make the command executable by me with chmod 700 test. I save the file in my home directory, and (attempt) to run the file like so: ./test Only for UNIX t...

If grep fails delete the file

Heya guys, I have this small script and i need to grep all the files and leave only the ones that contain a keyword and I'm stuck on this, any help in pointing out my dumb errors is appreciated :) #!/bin/bash server=(server1...server24) . . . for ((n=0; n <= 24 ; n++)) do if grep -q "KEYWORD" directory/${server[$n]}.html ; th...

Specify input date format for /bin/date

I'm creating Unix bash script that parses web-server log file and inserts this data into database. So I need to convert timestamp which has format "05/Oct/2010:07:38:40 +0400" into "YYYY-mm-dd". I've tried to use /bin/date -d, but it does not accept given format. I could not find a way to specify input date format for this tool. Is is p...

grep invert search with context

I want to filter out several lines before and after a matching line in a file. This will remove the line that I don't want: $ grep -v "line that i don't want" And this will print the 2 lines before and after the line I don't want: $ grep -C 2 "line that i don't want" But when I combine them it does not filter out the 2 lines befor...

To discuss on demerits of nohup.out specially related to process speed or space

Will nohup.out consume space / make the server slow if a shell is allowed to run in infinite loop in server using the command: "nohup ./shell & > nohup.out" I had written a small program in shell script that will run in infinite loop, (since I don't have privilege to add my script in crontab) and the output of the same is of 4 lines whi...

Shell application in Vim window

I'm searching a way to start console application in vim window. So I could open python & php interactive shell in it. It would be very handy. I want something like :10 sp !python ...

unix shell set command

Want to know what set -A option does in the below command? XMLOUTFILE=${XMLOUTDIR}/${TEST_ID} set -A FILES "${XMLOUTFILE}" ...

How to run 'cd' in shell script and stay there after script finishes?

I used 'change directory' in my shell script (bash) #!/bin/bash alias mycd='cd some_place' mycd pwd pwd prints some_place correctly, but after the script finished my current working directory doesn't change. Is it possible to change my path by script? ...

Shell Script for checking existance of a directory

if[-d /abmusr06/abm/users/dywrk01/run_time]; then echo "Pack installation Failed" exit(1) fi This the above code fine? ...

How to extract a jar to a particular location?

Hi, I am using jar -xf <name of the jar> -C <location where jar is to be extracted> But i am getting issues with the syntax. Please let me know where i am wrong or site some example. Thanks. ...

extracting portion of jar to a path

Hi, I am using the follwing command and my intention is to extract only DYEDistinctAppServer.topology from discovery1-full-8.1.0-07-10-2010_1055.jar at data/product/template-topologies/DYEDistinctAppServer.topology path. Command: jar -xf discovery1-full-8.1.0-07-10-2010_1055.jar -C data/product/template-topologies/DYEDistinctAppServ...