shell

Is there a way to use Cygwin to run shell scripts and use proper path seperators for java commands

I'm trying to use Cygwin to test startup scripts for a Java application that is going to run in a Linux environment. The troule is when I specify a boothclasspath or Classpath I need to use OS specific path seperators ";" for windows, and ":" for Linux. This happens because Java is still a native windows application and uses the native ...

What is the Visual Studio shell (standalone shell) good for?

Is it some sort of pre-built GUI scaffolding? Why would I Want it instead of a WinForms UI, which is quick to set up? What does it give me that I would have to spend time writing? Do I get floating windows and docking, like in Visual Studio 2008? Is there a money-cost to using it? What does the deployment look like - is my app a standal...

How do I set $PATH such that `ssh user@host command` works?

I can't seem to set a new $PATH such that it is used when executing commands via ssh user@host command. I have tried adding export PATH=$PATH:$HOME/new_path to ~/.bashrc and ~/.profile on the remote machine, but executing ssh user@host "echo \$PATH" shows that the change has not been picked up (it shows /usr/local/sbin:/usr/local/bin:/u...

What is the appropriate way to run higher privilege commands via over HTTP

I have a web project for which I need to run a command when a specific URL is requested, but that command requires root privileges. The project is served with a Python process (Django), of course running it with root privileges is not an option. The command's parameters are hardcoded making it impossible to inject anything and it's a r...

Handling FTP error codes

Most FTP clients return an exit code "0" even if an error occured during the file transfer. I am facing a problem, where in I am checking for the error codes. But my script gets the error code number in the bytes sent and the validation fails. I tried it like this: if [[ egrep '^202 |^421 |^426 |^450 |^500 |^501 |^503 |^530 |^550 |^5...

Detecting interactive shell within ksh ENV script

What's the preferred way to determine if a given ksh invocation is running an interactive shell? I have some commands in an ENV file that I would like to skip for non-interactive ksh invocations (e.g. when executing a shell script). I've seen suggesting ranging from: if [[ $- = *i* ]]; then # do interactive stuff fi ...to not ev...

How to save a Python interactive session?

I find myself frequently using Python's interpreter to work with databases, files, etc -- basically a lot of manual formatting of semi-structured data. I don't properly save and clean up the useful bits as often as I would like. Is there a way to save my input into the shell (db connections, variable assignments, little for loops and b...

How can I save a process resource from proc_open in order to check the status later on?

I'm running a sh script that runs a java process through php on ubuntu server. I'm using proc_open for running the process. usually the Workflow goes like : request a page -> script runs (until it's finished) -> result page. In my case the script runs in parallel so the server won't wait until the script is finished (it takes ho...

Killing process in Shell Script

Hi I have a very simple problem: When I run a shell script I start a program which runs in an infinite loop. After a while I wanna stop then this program before I can it again with different parameters. The question is now how do I find out the pid of the program when I execute it? Basically, I wanna do something like that: echo "Execu...

Get/Set TShellListView Path/Folder as String (Not Using .Root)

I want to set the path for a TShellListView to display a directory of files using Delphi 2007. I can initially use TShellListView.Root to set the root path like this and it shows the directory I want: View := TShellListView.Create(Self); // ... View.Root := 'C:\Windows'; But if the user navigates away from that directory using backsp...

Verbose output of shell script

Hi I have a very simple shell script that looks as follows: clear for i in -20 -19 -18 -17 -16 -15 -14 ... 18 19 do echo "Nice value is $i" nice -n $i ./app1 done Basically, I wanna run an application with all different priority values between -20 and 19. However, when executing this script it looks as follows: Nice value ...

How can I intercept errors from gzip so cron doesn't see them?

So, OK, the job runs in cron: it fetches compressed files and processes them. If the files are corrupted, it deletes them. Sometimes they are bad on the remote server, in which case they will be downloaded and deleted each time. My cron logs extensively to STDOUT (directed to logfile in .crontab), using STDERR only for things that cause...

Explore.exe Address Bar "Shell:" Command in Windows 7

With Windows 7 was just trying to navigate to c:\users\scott.cate\sendto to modify the [send to] context menu and I was getting access denied. With a little search engine work I found this trick. Open Windows Explorer (Win+E Shortcut) and type Shell:sendto into the addres bar and press enter. Windows Explorer opens up to C:\Use...

Java's interactive shell like ipython

I am quite new to java, and I would like to learn java just like python, with the interactive shell IPython. I try a few a them, like beanshell, jython, jythonconsole, JyConsole... Almost all of them don't have the function of tab completion like ipython. Is there anything similar to that? Thank you. ...

Windows Terminal - Windows Form to embed cmd

Hi! I'm looking for a way to embed a cmd "Shell" into a Form. I want to build a C# based application that acts as a Terminal, better than the Powershell window (no tabs) or cmd (no nothing). Just start these interpreters in the backend. I guess MS never thought of doing this. Any ideas what From elements I could use? Thanks, i/o ...

Redirecting StdErr to a Variable in a Bash Script

Let's say I have a script like the following: useless.sh echo "This Is Error" 1>&2 echo "This Is Output" And I have another shell script: alsoUseless.sh ./useless.sh | sed 's/Output/Useless/' I want to capture "This Is Error", or any other stderr from useless.sh, into a variable. Let's call it ERROR. Notice that I am using stdo...

Compiling fish shell under Cygwin?

Has anyone been able to correctly compile fish under Cygwin? I found this post about modifying configure.ac but I'm getting all sorts of errors. The usual configure, make, make install isn't working for me, maybe I'm doing something wrong here... Can someone please walk me through how to get it to compile? ...

Is there a way to resolve a .lnk target that works for links that end up in c:\windows\installer ?

The usual way to resolve lnk involve using WShell.WshShortcut or IShellLink that way : var WshShell = WScript.CreateObject("WScript.Shell"); var oShellLink = WshShell.CreateShortcut(strDesktop + "\\some-shortcut.lnk"); WScript.Echo(oShellLink.TargetPath) But there are links that can't be resolved that way : the resolution end up in c:...

manipulate parameters in sh

I'm working with a utility (unison, but that's not the point) that accepts parameters like: $ unison -path path1 -path path2 -path path3 I would like to write a sh script that I could run like this: $ myscript path1 path2 path3 I'm hoping for a Posix compliant solution, but bash-specific would also be good. I'm guessing it should ...

python: find out if running in shell or not (e.g. sun grid engine queue)

is there a way to find out from within a python program if it was started in a terminal or e.g. in a batch engine like sun grid engine? the idea is to decide on printing some progress bars and other ascii-interactive stuff, or not. thanks! p. ...