scripting

Scripting Automation within VB.NET application

The software company I work for offers data conversion as a service for new clients who have previously used other similar software. I've written a VB.NET application to automate common conversion operations, and have separate logic between known vendors. A particular file layout has become rather common, but due to the nature of how t...

MySQL conditional drop foreign keys script

I'm involved is a project to migrate a project from Oracle to MySQL. I Have a script that i'm running from the MySQL shell command, called CreateTables.sql that looks like this internally: source table\DropForeignKeys.sql source tables\Site.sql source tables\Language.sql source tables\Country.sql source tables\Locale.sql source tables\T...

Configure Apache to route "GET /user/foo" to /user/GET.php and "PUT /user/foo" to /user/PUT.php

I would like to arrange things so that a GET request for e.g. http://example.com/user/[email protected] internally calls the script /var/www/example.com/rest/user/GET.php and a PUT request for the same URL internally calls the script /var/www/example.com/rest/user/PUT.php and so on for the other HTTP verbs POST and DELETE. It's almos...

Batch script to take backup of all *.c and *.h files.

I am new to MS batch programing. I want to copy files with matching regex to destination with same directory structure. If I use dir /b /s, I get full path of source then how can I get the relative path from source path? I want DOS based batch script equivalent of something like this in bash script, file_list=`find ./abc/test -nam...

Bash scripting: How do I parse the output of a command and perform an action based on that output?

I am using wget to grab some files from one of our servers once an hour if they have been updated. I would like the script to e-mail an employee when wget downloads the updated file. When wget does not retrieve the file, the last bit of text wget outputs is file.exe' -- not retrieving. <blank line> How do I watch for that bit of text...

Determine Running Times of Videos in Directory using PowerShell

Hi, I have a directory of videos (.AVI files) that I want to determine the duration of, and to create a file listing the titles and durations of all the videos, sorted in descending order of the video duration. Can anyone offer a PowerShell script to do this? Thanks, MagicAndi ...

Expect - get variable from screen region based on row and column

I'm auto-interacting with an SSH session and an ERP program using Expect. Rather than relying on a regular expression to capture a variable in my expect script would it be possible upon receiving a certain keystroke from a user to capture a screen region, say one field, into a variable in the code? Send the server some other commands a...

Where can I find TTY and curses documentation for Unix?

I'm working on automation tools for an ERP program running on SCO Unix. See my questions on Expect: http://stackoverflow.com/questions/1987302/tcl-expect-clear-screen-after-exit http://stackoverflow.com/questions/1988811/expect-get-variable-from-screen-region-based-on-row-and-column Where can I find (either locally or on the web) res...

bash function to prompt for and return input

I'm trying to write a helper function to use in a bash script to take a variable prompt string and return the value the user inputs. What I have sits and waits for a user to input the value without displaying the prompt first, which is puzzling. It also stores the echo in the return value ($foo), and doesn't keep the value read in with...

Why many popular opensource PHP apps are plain script

This is part observation, part question. First the observation: While everyone talks of modular programming, OOP, procedural done right, aspect oriented, design patterns, etc., several popular opensource PHP apps are plain script files with the structure being controlled by includes and requires. This looked stupid to me till I faced a ...

Execute Scripts online

I'm searching for a website where I can test python scripts within a simple form (so I don't need to install python on my local machine). I know there is a site that can do it (also other script languages like javascript, php are supported...) but I forget the name. Anyone can help me? Thanks! ...

Modifying First and Last Name in Hotmail via script

I would like to write a script that logs into hotmail and changes the first and last name. I am thinking of perl for this, although I imagine that any language would do. How do I find out what requests to make? I'm guessing that I can do the change requests manually, determine what http requests are being sent to/from the server, determ...

Scrollable Div?

Does anyone know of a great jquery scrollable div (scrolls with window.scroll) that will only scroll within a div, i dont want to use position:fixed; as people have small browsers and might have it smaller than my div and cut it off? ...

How can I run a shell script from inside a Perl script run by cron?

Is it possible to run Perl script (vas.pl) with shell sript inside (date.sh & backlog.sh) in cron or vice versa? Thanks. 0 19 * * * /opt/perl/bin/perl /reports/daily/scripts/vas_rpt/vasCIO.pl 2> /reports/daily/scripts/vas_rpt/vasCIO.err Error encountered: date.sh: not found backlog.sh: not found Perl script: #!/opt/perl/bin/per...

How to execute a bash command stored as a string with quotes and asterisk

I try to execute the following command : mysql AMORE -u username -ppassword -h localhost -e "SELECT host FROM amoreconfig" I store it in a string : cmd="mysql AMORE -u username -ppassword -h localhost -e\"SELECT host FROM amoreconfig\"" Test it : echo $cmd mysql AMORE -u username -ppassword -h localhost -e"SELECT host FROM am...

Regular Expression to find string in Expect buffer

I'm trying to find a regex that works to match a string of escape characters (an Expect response, see this question) and a six digit number (with alpha-numeric first character). Here's the whole string I need to identify: \r\n\u001b[1;14HX76196 Ultimately I need to extract the string: X76196 Here's what I have already: interact...

PHP alternatives?

Are there alternatives to PHP that perform faster and have somewhat the same feature set (like support for common RDBMS, Curl, Regex, etc)? What about coding websites in C? How does that work out? Is that platform independent and works on each server? ...

When will this happen?

<script type="text/javascript" src="test.php"></script> The first time I visit that page,test.php is not visited, but if I refresh the page,it'll get run. Have you ever experienced this ? ...

script to filter files

I have a directory that have a lot of files, i want to loop to each file and open it search for a specific word and then i the word found copy the file into another directory. Thanks ...

Mutable list or array structure in Bash? How can I easily append to it?

I'm trying to collect string values in a bash script. What's the simplest way that I can append string values to a list or array structure such that I can echo them out at the end? ...