shell

How do I list files with edit locks on a network drive using a dos shell and associated tools?

How do I list files with edit locks on a network drive using a dos shell and associated tools? I think net file has to be run on the server, and I'm looking to do this from any box on the drive. ...

Shell Script Segmentation Fault

Hi I have a shell script which should run based on the return of php code: x=1 while [[ "$x" != 5 ]] do echo "Welcome $x" php test.php x=$? done And the php code echo "Testdfdf test".PHP_EOL; exit(4); So I want whenever I get 5 from php to quit the loop. But I get sometimes: ./myshell: line 7: 20529 Segmentation fault ...

Does anybody know what means ShellHook message HSHELL_RUDEAPPACTIVATED?

I am writing application which establishes shell hooks to get shell events (I am using C# if it matters). I am using this example: http://msbob.spaces.live.com/blog/cns!DAFD19BC5D669D8F!132.entry Hook is working fine but I do not receive message on which I am interested: HSHELL_WINDOWACTIVATED (all other window-related events work well)...

How do you use shell script variables as arguments to sed?

What I would like to do is something like the following: #!/bin/sh EMAIL="-e 's/SOMETHING//g'" somecommand | sed "$EMAIL" But I get the following: sed: -e expression #1, char 2: unknown command: `'' I've tried many variations. I know it just a matter of getting the string quoting right. The reason I'd like to do this is to break...

osx change file encoding (iconv) recursive

hi, I know I can convert a single file encoding under OSX using: iconv -f ISO-8859-1 -t UTF-8 myfilename.xxx > myfilename-utf8.xxx I have to convert a bunch of files with a specific extension, so I want to convert file encoding from ISO-8859-1 to UTF-8 for all *.ext files in folder /mydisk/myfolder perhaps someobe know the syntax how ...

i18n shell in windows

Is there an i18n shell in windows that supports a large character set? Testing my application in windows results in some math characters not being rendered correctly. The Lucida font in cmd.exe and powershell do not have a wide enough selection. Unicode UTF-8 would be the most preferable, followed by the other Unicode encodings. ...

Django runserver permanent

How can I make the development server from django running permanent? So that it does't stop when i quit the shell. Thanks ...

bash parameter expansion changes original string

I have inherited a shell script. One of the things it does is parsing of a list of filenames. For every filename in the list it does following command: fs_item="`echo ${fs_item%/}`" This command (a part from doing it's job which in this case, I think, is to remove everything after last slash) replaces spaces in filename with one space...

Shell documentation (bash, ksh)

is there a tool out there similar to Javadoc or POD for shell scripting? thanks EDIT: I am not looking for existing shell man pages - there is a lot of ksh/bash code we write/support, so I was looking for a nice way to communicate what's happening, whether there is a potential for code reuse, etc. all things Javadocs are good for. ...

How to define variables and constants for a linux user account?

Say I created a linux user account called john. John wants to create a variable called MYVAL with the value Hello World in the linux shell (bash) MYVAL = 'Hello World' John does not want to redeclare this variable every time he logs in. Is there some linux config file or start up file that john can declare this variable in such that it...

Problem executing TCL script from Bourne Shell (redirection trouble)

I am working with VMD (a molecular dynamics visualization package) and I want to open VMD from a Perl script, run a Tcl script, print the output to a log file, then close VMD and return to the Perl script. The ordinary syntax to do this is: system("vmd -dispdev text -eofexit < program.tcl > LOG"); which breaks down as follows, as best...

Generate random number

How to generate a random number in bash? ...

Potential Dangers of ALIASing a Unix Command Starting with "."?

I'd like to use alias to make some commands for myself when searching through directories for code files, but I'm a little nervous because they start with ".". Here's some examples: $ alias .cpps="ls -a *.cpp" $ alias .hs="ls -a *.h" Should I be worried about encountering any difficulties? Has anyone else done this? ...

Equivalent to Unix eval in Windows

Was wondering how you'd do the following in Windows: From a c shell script (extension csh), I'm running a Python script within an 'eval' method so that the output from the script affects the shell environment. Looks like this: eval `python -c "import sys; run_my_code_here(); "` Was wondering how I would do something like the eval sta...

Source shell script into environment within a ruby script

If I'm writing a shell script and I want to "source" some external (c-)shell scripts to set up my environment, I can just make calls like this: source /file/I/want/to/source.csh I want to replace a shell script that does this with a ruby script. Can I do a similar thing in the ruby script? Update: Just tried it with test_script.csh: ...

How to get variable in CGI made by /bin/sh + Apache

I'm coding following CGI script echo "Content-type: text/html; charset=UTF-8\n\n" echo "<HTML><HEAD><TITLE>title</TITLE></HEAD>" echo "<BODY>" echo "<FORM ACTION="http://exapmle.com/page2.cgi" NAME="PAGE1" METHOD="POST">" echo "input:<INPUT TYPE=text NAME="data1" SIZE=10 MAXLENGTH=10>" echo "<INPUT TYPE=submit NAME=nbtn VALUE='GO TO PAG...

How to get local application data folder in Java?

I'm looking for a way to get the location of the local application data folder, which is a special Windows folder, in Java. Unfortunately, the following only works for English versions of Windows XP with default settings: System.getProperty("user.home") + "\\Local Settings\\Application Data" What I'd like to have is something like thi...

How do I find the latest version of an artifact from a maven repository

As part of an automated deployment I need a script to download the latest version of an artifact from our internal repository. Ideally this script will be with ant or a unix shell script. So for example: I have myArtifact.war and it has versions 1.0 , 1.1 and 2.0 - I need the script given the correct group id and artifact id to retrie...

How to get a fully qualified path to MS Explorer in .NET?

How to get a fully qualified path to MS Explorer in .NET? The path will be used to launch a new instance of MS Explorer with some command line parameters. ...

How expand a CMD shell variable twice (recursively)

Using the Windows XP CMD command-line I can expand a variable twice as follows: set AAA=BBB set BBB=CCC for /F "usebackq tokens=*" %i in (`echo %%AAA%%`) do echo %i will echo CCC. I.e. AAA has been expanded to the string BBB, and then the variable BBB has been expanded to CCC. This doesn't work from inside a batch script (i.e. a .cmd...