scripting

Grep and Sed Equivalent for XML Command Line Processing

When doing shell scripting, typically data will be in files of single line records like csv. It's really simple to handle this data with grep and sed. But I have to deal with XML often, so I'd really like a way to script access to that XML data via the command line. What are the best tools? ...

Use grep to find content in files and move them if they match

I'm using grep to generate a list of files I need to move: grep -L -r 'Subject: \[SPAM\]' . How can I pass this list to the mv command and move the files somewhere else? ...

Can I automatically 'Generate Scripts' in a SQL Server 2005 task?

I'd like to automatically generate database scripts on a regular basis. Is this possible. ...

What are some good OpenID libraries?

I was thinking about using OpenID for I site I am building and was wondering if any libraries or scripts exist for making OpenID easier to implement. (Why reinvent the wheel?) I was planning on using PHP for the site because it is going to be fairly simple and small, so a php script would be ideal. But any language would be great. Than...

Korn Shell code to send attachments with mailx and uuencode?

I need to attach a file with mailx but at the moment I'm not having a lot of success. Here's my code: subject="Something happened" to="[email protected]" body="Attachment Test" attachment=/path/to/somefile.csv uuencode $attachment | mailx -s "$subject" "$to" << EOF The message is ready to be sent with the following file or link a...

How do I create a nice-looking DMG for Mac OS X using command-line tools?

I need to create a nice installer for a Mac application. I want it to be a disk image (DMG), with a predefined size, layout and background image. I need to do this programmatically in a script, to be integrated in an existing build system (more of a pack system really, since it only create installers. The builds are done separately). ...

How can I make Windows software run as a different user within a script?

I'm using a build script that calls Wise to create some install files. The problem is that the Wise license only allows it to be run under one particular user account, which is not the same account that my build script will run under. I know Windows has the runas command but this won't work for an automated script as there is no way to e...

What's the best automation or scripting tool to automate repetitive tasks with applications?

I realise you can script Microsoft Office apps, but I'm looking for something more general that I can apply to other apps, such as Adobe Acrobat, web browsers and other apps with no scripting ability. I've used AutoIt but it's a bit clunky, especially when trying to debug why a script fails or stalls. Also, getting the timing of actions...

When is a language considered a scripting language?

What makes a language a scripting language? I've heard some people say "when it gets interpreted instead of compiled". That would make PHP (for example) a scripting language. Is that the only criterion? Or are there other criteria? See also: What’s the difference between a “script” and an “application”? ...

Build new computer using Scripts

I would like to automate the process of setting up a new PC, this would include downloading and installing the latest windows and office updates; installing software from a network share (some software will require a restart so the script would need to be able to login and continue) adding PC to a domain and setting up local user account...

How do you glue Lua to C++ code?

Do you use Luabind, toLua++, or some other library (if so, which one) or none at all? For each approach, what are the pro's and con's? ...

Possible to monitor processes another process launches via WMI?

I have a setup executable that I need to install. When I run it, it launches a msi to do the actual install and then dies immediately. The side effect of this is it will return control back to any console you call it from before the install finishes. Depending on what machine I run it on, it can take from three to ten minutes so having t...

How do I get the result of a command in a variable in windows?

I'm looking to get the result of a command as a variable in a Windows batch script (see how to get the result of a command in bash for the bash scripting equivalent). A solution that will work in a .bat file is preferred, but other common windows scripting solutions are also welcome. ...

Shut-down script on Windows to delete a registry key?

EDIT: This was formerly more explicitly titled: - "Best solution to stop Kontiki's KHOST.EXE from loading automatically at start-up on Windows XP?" Essentially, whenever the 40D application is run it sets up khost.exe to automatically start-up with Windows. This is annoying as it increases my boot up time by a couple of minutes and I d...

Javascript interpreter to replace Python

In terms of quick dynamically typed languages, I'm really starting to like Javascript, as I use it a lot for web projects, especially because it uses the same syntax as Actionscript (flash). It would be an ideal language for shell scripting, making it easier to move code from the front and back end of a site, and less of the strange syn...

What is the difference between "lang" and "type" attributes in a script tag?

For <script> HTML tags, what is the technical difference between "lang=Javascript" and "type=text/javascript"? I usually use both, because I've always assumed that older browsers need one or the other. ...

Wrap an executable to diagnose it's invocations

I have a Windows executable (whoami) which is crashing every so often. It's called from another process to get details about the current user and domain. I'd like to know what parameters are passed when it fails. Does anyone know of an appropriate way to wrap the process and write it's command line arguments to log while still calling...

Syntax to declare JS scripts

Hi! I'm not sure about what's the difference between opening a JS script with <SCRIPT language='JavaScript'> or with: <SCRIPT type="text/JavaScript"> Should JavaScript always be quoted (either with " " or with ' ') or that's not really important? Thank you for any clarification on this topic! ...

What would be the simplest way to daemonize a python script in Linux ?

What would be the simplest way to daemonize a python script in Linux ? I need that this works with every flavor of Linux, so it should only use python based tools. ...

Copy all files and folders using msbuild

Hi all, Just wondering if someone could help me with some msbuild scripts that I am trying to write. What I would like to do is copy all the files and sub folders from a folder to another folder using msbuild. {ProjectName} |----->Source |----->Tools |----->Viewer |-----{about 5 sub dir...