Hi, I would like to excute a command in shell script.
This command will have a return code, 0 or non-0 if success or not.
If success, it will print something.
Now I need the printed stuff in shell script. How can I do that?
I know that I might redirect to a file and then read the file. Is there any way to redirect it to a variable...
I can download files using wget "ftp://user:pass@host/prefix*, but I cannot remove downloaded files from FTP. Any easy solution to do this in bash script?
...
In a Unix shell script, to call command 'foo' on the original arguments to the script, you just write
foo $@
In Powershell, $args is an array of (typically) strings holding the current script's arguments. If you write
foo $args
will the same thing happen as in bash or other typical Unix shell script interpreters?
...
VAR="-e xyz"
echo $VAR
This prints "xyz", for some reason. I don't seem to be able to find a way to get a string to start with -e.
What is going on here?
...
Is there a module out there that can give me links to all the pages a website has??
Why I need it: I want to crawl some sites and search for tags in them, searching only on mainpage is not enough.
Thanks,
...
I've been experimenting with embedding different scripting languages in a C++ application, currently I'm trying Stackless Python 3.1. I've tried several tutorials and examples, what few I can find, to try and run a simple script from an application.
Py_Initialize();
FILE* PythonScriptFile = fopen("Python Scripts/Test.py", "r");
if(Pyth...
I am looking for a GUI scripting workaround since I know this seems impossible in Firefox at the moment. I know this can be achieved using the following method:
tell application "System Events"
Keystroke "l" using command down
Keystroke "c" using command down
end tell
tell me to activate
set theUrl to the clipboard as te...
Hi,
i'm trying to run a number of classes which reside in the Maven 'test' folder from the command line which i will later combine to run in a ksh script.
The issue i am having is that i can run files which are in the 'main' folder but i want to run another which is in the 'test' folder.
Does anyone know, or have any ideas as to how t...
Hi,
i want to run and control PSFTP from a Python script in order to get log files from a UNIX box onto my Windows machine.
I can start up PSFTP and log in but when i try to run a command remotely such as 'cd' it isn't recognised by PSFTP and is just run in the terminal when i close PSFTP.
The code which i am trying to run is as follo...
I have a script that I'm using to remove duplicate Calendar entries. The root mail folder contains folders with each folder being firstname_lastname, then beneath each other is /Calendar/#msgs/.
As of now, I'm running script manually by going to the users' folder and starting the script /Users/Documents/duplicates/dups.pl . --killdups`...
Hello,
I have a script that we've been using for maintenance to clear up duplicate calendar items on our mail server. What we've found is that although it can remove the duplicate items we need to ALSO remove the originating item.
The script is run by dups.pl . --killdups then it will report which are a dup of the original.
What I'm ...
I have an app that processes images. For testing it, I have a script that submits an image. This is not completely uncommon.
I am bored with my test images. Filling up a folder with some images and getting my test script to randomly pick one gets boring really quickly.
Is there any script - in any language, really - that can get a r...
Hi there! I would like to make my PHP script freeze at a screen for at least 5 seconds before loading into the next script. I have tried "Sleep()" however that is not the function I am looking for as it only pause the script that is "going" to be loaded.
Here are my codes:
echo "Welcome ",$_SESSION['username']."<br>";
echo "Click h...
I have the following appcmd to add an exception to IIS7's ISAPI and CGI restrictions. The exception I am adding should look like:
c:\perl\bin\perl.exe "%s" %s
Here is the command line:
appcmd set config -section:isapiCgiRestriction "-+[path='c:\perl\bin\perl.exe \"%s\" %s', allowed='true', description='Perl CGI']"
If execute this fr...
I have a monolithic trunk which is comprised of many projects and their corresponding shared modules. I wish the database was organized in a more flexible manner, but it isn't. What I'd like to do is create a branch which is a sort of project-specific refined view of the trunk. Really, it's a tag, because I only want to write it once ...
I'm in charge of a printer, so I wrote a script which runs every 5 minutes and figures out if the printer has paper. If it doesn't, the script will text me. The problem is, if I'm busy, and can't fill the printer, I don't want the script to continue to text me every 5 minutes. Is there a way I can force it to only send me at most 1 tex...
I'm interested to know how can I get the yahoo messenger status, as some sites do. I've find how to get the online/offline status, but not the invisible status as in this website: detectinvisible[dot]com
Do you have any idea?
...
I'm looking for a good way to push code quickly and securely to my company's Windows web servers for release deployments.
I have a *nix background and in the past have always used rsync in conjunction with ssh for such tasks because it is quick, secure, and scriptable.
Right now our deployment process is very manual and requires loggin...
How can I run a windows batch file but hiding the command window? I dont want cmd.exe to be visible on screen when the file is being executed. Is this possible?
...
I write a number of simple scala scripts that end up starting with a simple pattern match on args like:
val Array(path, foo, whatever) = args
// .. rest of the script uses "path", "foo", etc.
Of course, if I supply the wrong number of arguments, I get an inscrutable error like:
scala.MatchError: [Ljava.lang.String;@7786df0f
at Ma...