scripting

git: Find all uncommited locals repos in a directory tree

...

Is Lua development stagnated, or are there still new versions planned?

Hi there SO, I was looking into learning Lua because it has some interesting features (speed being one), and I noticed that there hasn't been a feature update since 2006. Has Lua development stopped? If it hasn't, where can I read about recent progress? Edit: All caps Lua is what happens when you post on SO at 3 AM. ...

Ruby telnet hangs during the enter password prompt

I am extremely new to ruby and just trying to use it to do some basic scripting. Namely telnet into a machine and use the dos ftp client to pull some files over. The problem that I have is when I try to telnet into the machine manually (from command prompt) I get the following message: Welcome to Microsoft Telnet Client Escape Cha...

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 ...

Sync Subversion and Harvest repositories?

How would you integrate Subversion and CA Harvest if using Subversion to sync work across a team and Harvest as the enterprise system of record? An approach I'm investigating is creating a script that loads a SVN tag into Harvest, but am curious if anyone else has done something like this before or there is a better way to approach the ...

Inserting column between other columns in SQL Server using script

I am trying to alter a table in SQL server with a script. In the past I have always done this kind of thing through a GUI, but now I need to generate a script to do it for customers. I have an SQL Server database table that is like this: MyTable ------- ColA int NOT NULL ColB int NOT NULL ColC int NOT NULL ColD VARCHAR(100) The pri...

Lotus Notes - scripting the creation of design element

I have a Lotus Notes application which actually consists of a template with all the required forms, views and agents needed. It also requires some design elements (a custom form and a view for our own type of documents) from this template to be copied over to the mail template, so after the regular refresh all users have it. The applica...

Ruby scripting - Telnet Hangs During Login

I am trying to do some basic scripting using ruby to log in to a windows machine via telnet and pull some files over using the dos command line ftp. When I do this manually everything goes swimmingly but when I try it via ruby I'm getting an error in the login call. Here is my test program in its entirety: require 'net/telnet' tn = Ne...

In SQL server is there any way to get the 'use database' command to accept a variable

I would like to write a 'generic' script to operate on a number of databases. The 'use databasename' commands will be distributed in the body of the script. I would rather show the database name information at the top of the script. So ideally: declare @db varchar(100) set @db = 'data_in' use @db This fails. So perhaps declare @db ...

Powershell script problem (Get-content vs assigning to variable)

Hello everyone, I'm attempting to write a Twitter Powershell script that will use community created interfaces PoshTwitter with the Twitter API to attempt and find a list of followers who are potential spammers. I have a feeling that my problem lies not with the particular cmdlet I'm calling (Get-TwitterFollowers), but rather with the ...

Unit testing for shell scripts

Pretty much every product I've worked on over the years has involved some level of shell scripts (or batch files, PowerShell etc. on Windows). Even though we wrote the bulk of the code in Java or C++, there always seemed to be some integration or install tasks that were better done with a shell script. The shell scripts thus become par...

What is a scripting language that understands datatypes and can be implemented in Java?

I am looking for a scripting language that meets the following criteria: Well Documented Implemented in Java Understands Datatypes (can handle longs, strings, etc) Is fully extensible Any suggestions? Currently, I'm using Javascript, but the Doubles that it sets numbers to is not big enough for the data work I'm doing. Thanks! ...

Is it possible to implement a `trap' for GNU make

I'm wondering if there's a way to implement the similar functionality as you get in bash scripts using `trap', but for gmake, such that if the user presses CTRL-C, or if make itself fails, it can call a particular target or macro. ...

shell script to spawn processes, terminate children on SIGTERM

I want to write a shell script that spawns several long-running processes in the background, then hangs around. Upon receiving SIGTERM, I want all the subprocesses to terminate as well. Basically, I want a "master process". Here's what I got so far: #!/bin/sh sleep 600 & PID1="$!" sleep 600 & PID2="$!" # supposedly this should kill...

Xcode: Running a script before every build that modifies source code directly

What I did: I have a script that Read some configuration files to generate source code snippets Find relevant Objective-C source files and Replace some portions of the source code with the generated code in step 1. and a Makefile that has a special timestamp file as a make target and the configuration files as target sources: SRC =...

Number of tokens limit in a FOR command in a Windows batch script

Hello, I was trying to process a text file in a Windows batch script and I ran into something that looks like a limitation to 31 tokens in a FOR loop. I isolated the issue in the code below: @ECHO OFF SET DATA=01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 FOR /F "tokens=31* de...

Can I create a One-Time-Use Function in a Script or Stored Procedure?

In SQL Server 2005, is there a concept of a one-time-use, or local function declared inside of a SQL script or Stored Procedure? I'd like to abstract away some complexity in a script I'm writing, but it would require being able to declare a function. Just curious. Thanks!! ...

Windows Command Line Script to rename a folder to current month -3 (e.g. 2009-04 to 2009-01)

What would the Windows command line script be to rename a folder from the current month, to the current month - 3, using the format YYYY-MM ? e.g.: c:\myfiles\myFolder\ should become: c:\myfiles\2009-01\ ...

write a batch to change the path for Mapped drive.

I having server folder as a mapped network drive in workstation . Now the that folder is shifting to to another server so Ineed to change the path this activity I need to do at 400 workstations. so can you help me with script. ...

clean links to PHP-generated javascript and css

Background: When generating HTML content with PHP or any such thing, it is possible to encapsulate links to javascript and css inside tags without actually having to include the CSS and JS "in-line" with the rest of the content. All you have to do is create a link to the file. Example: {script type="text/javascript" src="./js/fooscr...