scripting

Preserving 'ls' output format over network

I have 2 machines A and B. I wish to have the output from B printed in a terminal on A. I run the following in a loop on A: nc -l -p 65000 On B, all output is tee'd to /dev/tcp/A/65000 This works most of the time, but output from programs such as 'ls' lose their colour and tab formatting. Is there any way to get this to work, such ...

How do I recover STDIN from a perl script that was called from a csh script?

I have a terrible nested script structure I am maintaining that takes user input from the keyboard periodically and I am trying to write a script that will automate this input. Essentially, the script structure looks like this: cmd1.csh takes 3 lines of input and then calls cmd2.csh, then exits normally cmd2.csh calls cmd3.pl twice an...

Resharper scripting (with custom actions)

I have a large number of auto-generated (from XML) classes that also can contain some manually added members. When doing it's work, the generator would only add new members to the file, and leave the rest alone. Now I've decided to split the class to two files. One containing auto-generated content, and other containing manual members an...

DOS script to check if the default java installed version is greater than 1.x

As the subject said, i need a dos script to check the version of java installed on windows xp Machine. Furthermore, I need to check if the version is greater than a prefixed value 1.x. Anyone can help me? Thanks! ...

Trigger an event when system locks/unlocks on Windows XP

Please help me to find a way to track lock/unlock time on my WinXP machine. I've tried windows scheduler - it only logs logins, not locks. Any alternatives? In Miranda's source code I saw implementation via IdleObject tracker, but this way is too long. May be an AutoIt script? Time tracking program (freeware)? ...

'Translate' .sh to .bat

HI! I would like to use this simple script.sh: #!/bin/sh filename=$1 echo $filename | sed 's/\([A-Z]\)/ \1/g'; In a script.bat, but my computer is not Windows, so I can't test it. This one would be correct?? prueba.bat filename=%1 echo %filename% | sed 's/\([A-Z]\)/ \1/g'; Thanks in advance ...

How to pass in parameters to a SQL Server script called with sqlcmd?

Is it possible to pass parameters to a SQL Server script? I have a script that creates a database. It is called from a batch file using sqlcmd. Part of that SQL script is as follows: CREATE DATABASE [SAMPLE] ON PRIMARY ( NAME = N'SAMPLE', FILENAME = N'c:\dev\SAMPLE.mdf' , SIZE = 23552KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LO...

How do I extend masked values across the row in KaleidaGraph?

I am scripting KaleidaGraph macros and I am looking for a way to extend a mask obtained from selection on a plot across the entire row of values. At present masked values obtained from a plot only mask the values in the columns plotted, whereas I need to mask the values in all the columns. ...

Something wrong with my sh script dont know why?!?!?!...

I wrote this sh script here. What it suppose to be doing is it prompts the user to type in the old password, then checks the password with the password in the "PASSWORD.txt" file if not it would exit, else if it matches then it would ask the user to type in the new password twice. Then it checks if the two new passwords are the same if n...

Using Curl to download files that require logging in

I need to download movie files from a website that requires logging in. I started prototyping a script using Mechanize, but I'm wondering if Curl supports sending username and password to the server, which would make my work a lot faster. ...

Running Python command-line utility from Java

Hello: I developed a command-line utility which needs to be called from a Java GUI application. The team in charge on the Java GUI would like to bind my command-line application to a button in the GUI; the Python application is such that at the time we have no time or interest in rewriting it in Java. I have no experience whatsoever in...

Python datetime TypeError, interger expected

I'm pretty new to Python, so hopefully the problem I'm having has a simple solution. At work we always us either Shell (ksh) or Perl for all of our scripting work. Since python has been shipped with Solaris for some time now, it has (finally) been given the green light as a scripting platform. I've started prototyping some improvements ...

How to create Access database from a script.

I would like to create an Access database from a script. Ideally, I would love something similar to the way SQL scripts can be used to create a SQL database. Is this possible at all? Is there anything that would leverage the SQL scripts I already have? I want to create the same database structure as my SQL database. Let me know if you...

C#.NET console app (.exe) versus VBScript (.vbs) for Scheduled Tasks

I have the following VBScript: Dim strFile, strXPath, strNewText, xmlDoc, xmlNodes, xmlNode strFile = "C:\folder\cats.xml" strXPath = "/list/cat/@LAST_BATH" strNewText = Now Set xmlDoc = CreateObject("Microsoft.XMLDOM") xmlDoc.Async = "False" xmlDoc.Load(strFile) Set xmlNodes = xmlDoc.selectNodes(strXPath) For Each xmlNode in xmlN...

Strategy for Stopping Java Processes in Windows XP

I am working with an application that consists of 10 or so Java processes that communicate through JINI, JMS, Sockets, and an HSQL db running on Windows XP. It seems that each part of the application has its own .bat file. For instance there is: ActiveMQ Broker HSQL Server JINICore Services RMI Registry 5 Java mains that run 1 Java G...

PostGreSQL without password prompt : .pgpass ignored

Hello all, I'm trying to enable root (Ubuntu 8.04) to use psql command without password prompt (for scripting purpose). Everything worked fine with PostGreSQL 8.3, but I migrate to PostGreSQL 8.4 and the login without password doesn't work anymore. I've a correct .pgpass file (the same used for 8.3), the right of /root/.pgpass are 0600...

Get integer portion of string in Pascal

I have a string Alpha 2 from which I need to extract the integer portion i.e. 2. This is a quick and dirty project and I'm not currently interested in learning Pascal. All I need is a quick answer! ...

Why is my preview file doesn't work in sh???

What this is meant to do is, collects the arguments which are the names of the image files and checks them if they exist and are readable, then it converts the image to the preview file in the layout (imagename)_preview.jpg and underneath it it would have the size of the orignal file in 'bytes'. Here is my script. #!/bin/sh clear for i ...

Fastest scripting language for Java?

I'm making a falling sand game in Java. I want users to be able to write their own engine for the game and I thought a scripting language might work for that. I've tried out a small script with jython and it's many times slower than that java version. I need a scripting language that has fast loops and/or fast array access since that's ...

Retrive msiexec error code from script

Hi, I have 2 problems that i need help with: I need to create a script to get the (error/success) code of an installation with msiexec. Any resources, examples about this? If my WIX Custom Action fails how can i return an error code for the installation? Any examples? Thank you, Adrya ...