shell

fastest hashing in a unix environment?

Hi, I need to examine the output of a certain script 1000s of times on a unix platform and check if any of it has changed from before. I've been doing this: (script_stuff) | md5sum and storing this value. I actually don't really need "md5", JUST a simple hash function which I can compare against a stored value to see if its changed....

how to make a single shell-script to activate on multiple commands?

I would like to have one single file in my /bin which would "listen" to various commands, e.g. when I type into my console ck sx I would like script ck to do "sx" command, and when I type ck st I'd like it to do another thing, "st". I bet it's easy to achieve I just don't know how exactly. The idea is to have certain c...

How do I make the "show/hide desktop icons" setting take effect?

The code below calls SHGetSetSettings function to hide desktop icons but it just unchecked "Show desktop icons" from the view menu. I called SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_FLUSHNOWAIT, nil, nil); to update the desktop but that doesn't work? var lpss: SHELLSTATE; begin lpss.Data := High(cardinal); lpss.Data2 := Low(cardi...

How to determine the current shell i'm working on ?

How to determine the current shell i am working on ? Does ps command output will alone do ? How to do this in different flavors of UNIX ? ...

Hadoop job fails when invoked by cron

I have created the following shell script for invoking a hadoop job: #!/bin/bash /opt/hadoop/bin/hadoop jar /path/to/job.jar com.do.something <param-1> ... <param-n> & wait %1 STATUS=$? if [ $STATUS -eq 0 ] then echo "SUCCESS" | mailx -s "Status: "$STATUS -r "[email protected]" "[email protected]" exit $STATUS else echo "FAI...

In kshell Make file Can i know the syntax of if else

In kshell Make file Can i know the syntax of if else where it should check different paths if (b folder found) select this path else should select other path or existing path ...

:(){ :|:& };: Forkbomb?

Possible Duplicate: The following bash command will spawn processes to kernel death. Can you explain the syntax? :(){ :|:& };: running this fork() unlimited .. Can one please explain this bash script ? ...

Change two or more spaces to a single semicolon

Hi! I am struggling with formatting of a db2 query. I would like to replace 2 or more spaces in a string with a semicolon. I know how to do it with all spaces, the question would be how to change only 2 or more spaces :P Here is an example, i would like to change this: john doe 1900-01-01 california to john doe;1900-01-01;cal...

VB.NET shell open PDF to a specific page

How do I open a pdf file to a specific page within the pdf. Below is a link to some of the open parameters when using command line: PDF Open Parameters ...

Widget is disposed

Good Mourning everybody I have a main screen, with follows keybindings: shell.getDisplay().addFilter(SWT.KeyUp, new Listener() { @Override public void handleEvent(Event event) { switch (event.keyCode) { case SWT.ESC: shell.close(); break; case SWT.F12: display.syncExec...

Linux shell strange situation

Does anyone know why the following script works? #a-random-junk-string echo HI The shell executes the echo command, and outputs HI. I thought that since there is no "!" after the "#", the shell would give an error. ...

differnce between the shell and environment variable in bash

what is difference between shell and environment variable & what are storage location for each of them ? ...

In a makefile, how to get the relative path from one absolute path to another?

An example to illustrate my question: Top level makefile rootdir = $(realpath .) export includedir = $(rootdir)/include default: @$(MAKE) --directory=$(rootdir)/src/libs/libfoo Makefile for src/libfoo currentdir = $(realpath .) includedir = $(function or magic to make a relative path from $(currentdir) to $(includ...

run php script concurrently

I'm trying to use a script to process a lot of dta records, let's name it process.php, the problem is that I have a huge data set, to make the job done faster, I want to run multiple instances of this script with /usr/bin/php process.php start_record end_record & so I'll have them running in parallel like /usr/bin/php process...

PHP: How to transport vars from php cmd (executing from shell) to PHP GET and POST Array?

Hi all, i have some scripts that need GET and POST values to start, and i wanna test them over shell. Is there some way to pass the values to that arrays to avoid using getenv() function? Thanks in advance! ...

shell script to traverse files recursively

I need some assistance in creating a shell script to run a specific command (any) on each file in a folder, as well as recursively dive into sub-directories. I'm not sure how to start. a point in the right direction would suffice. Thank you. ...

How to tell which unix shell I am using?

Is there an easy way by which I can tell which type of unix shell I am in i.e. whether I am in a bash / csh / ksh / tcsh ? ...

Sending commands over ssh with parameters

Hi I am trying to send a command over ssh with a parameter but the shell fails to expand the command properly any ideas what am i doing wrong with this for i in 71 72 73 74 75 do for server in server1 server2 do somestr="Some String" echo "$server hdiskpower$i \c" ; ssh $server "lsattr -El hdiskpower$i |grep $so...

##*/ use in UNIX Shell Scripting

Hi, Could anyone eloborate how ##*/ works in UNIX Shell scripting. I have seen it's use in Korn Shell. It is specifically used for removing extension of file. e.g. func_write_app_log "o Deleting status file ${CIE_STATUS_FILE##*/}" Here suppose the file is CIE_STATUS_FILE.DAT, then ##*/ will display CIE_STATUS_FILE ...

Debugging monit

I find debugging monit to be a major pain. Monit's shell environment basically has nothing in it (no paths or other environment variables). Also, there is no log file that I can find. The problem is, if the start or stop command in the monit script fails, it is difficult to discern what is wrong with it. Often times it is not as simple ...