script

Using time command in bash script

I'd like to use the time command in a bash script to calculate the elapsed time of the script and write that to a log file. I only need the real time, not the user and sys. Also need it in a decent format. e.g 00:00:00:00 (not like the standard output). I appreciate any advice. ...

Scheduling jobs on windows

Hi all, What is the best way of scheduling simple batch jobs on windows? My current need is to dump some SVN repositories each night and FTP the dumps to our external FTP side and then e-mail one or more people that the backup has completed/failed. This sounds like the sort of thing I would usually do in a unix script + cron. Is that...

Bash script log file rotation

My bash script produces a log file. Now i'd like to implement some log file rotation. Let's say the first time it's called somelog.log, the next time it's renamed to somelog.log.1 and the new log file somelog.log.The third time the new log is somelog.log again, but somelog.log.1 is renamed to somelog.log.2 and the old somelog.log to some...

SQL Server 2008 generate script wizard gives me a script that results in "unclosed quotation marks"

Hi, I have an SQL server 2008 database instance on one machine. Now I want to copy this database to another machine. I use the script wizard inside SQL Management Studio to generate a SQl-script with the schema and data. The script-file is rather big (around 17 GB). Then I run the sql-script on the target machine it results in a : Ms...

all shell-script commands in batch-commands portable?

hi, I'm no linux user (yes, I'm sorry!) and a friend of mine asked me to port his shell script for linux into a batch for windows, because he wants to do the same task there to. I haven't worked with shell-scrips before and my batch skills are, hmmm, almost not existing, but I would like to try that. So I would like to ask if there ar...

Google Spreadsheet: Script to Change Row Color when a cell changes text;

Hi, I have a googlespreadsheet where I keep a list of bugs and whenever I fix a bug I change the status from "Not Started" to "Complete". I want to write a script for the Google Docs spreadsheet such that whenever I change the status to "Complete" the entire row gets highlighted in a certain color. I already know that Google Spreadshe...

removeChild <script> before JavaScript executes

I have a local file that I am displaying in an iframe. I cannot alter the file (or any files included- css, script, etc). I need to remove all of the tags from the file. This is easy enough, but I would like to remove them before the JavaScript inside them is executed. Simply doing: window.onload = function(){ iframeHEAD.removeChil...

<script> or <noscript>?

hey guys, i just wonder what's the better solution. I have an iFrame with a google map on my website. the iframe has an id="map". I wonder now what's the better solution if I don't want the map to show if javascript is turned off. should I have a <noscript> <style type="text/css"> #map {display:none) </style> </noscript> or can I w...

shell script cut and sed help

I have 2 two files $cat file1.txt field1=value1 field2=value2 field3=value3 :: :: $cat file2.txt something.field1.some otherthing.field2.anything anything.field3.something I need to read file1.txt and check whether file2.txt for fieldN and replace with valueN so that the result will be something.value1.some otherthing...

PHP Upload Timeouts: More Efficient Upload Script?

Hi Guys, I have written a pretty basic upload script that takes the file and uploads it using the standard move_uploaded_file method as you see below: //UPLOAD IMAGE $path = "../../clients/$realClient/" . $_FILES["image"]["name"][$x]; move_uploaded_file($_FILES["image"]["tmp_name"][$x], $path); $displayPath = "pr...

How to set up an environment in Eclipse CDT by script per project?

I have got several projects in my workspace. I have a script which set a different environment for each project. How can i get Eclipse CDT to use this script to set up the environment instead of setting everything by hand for each project? Thanks. ...

Batch script to read file contents into an array

H guys, using a windows batch script I am looking to pass a run a command x number of times with a different argument each time, the arguments being parsed in from a file. For example have a textfile saying arg1 arg 2 arg3, the batch script would parse this and run program.exe -arg1 program.exe -arg2 program.exe -arg3 I am thinking r...

XML SAX parser for scripting using reflection

I'd like an opinion about to create an hypothetic scripting system using XML. The idea is to use a SAX parser and C# reflection. I cannot find a library/framework which allow to specify custom action using XML files. At this time I use XML for serialize application classes, bug could be awesome to specify which actions the application s...

System for keeping track of user favorites

Hey there! On my website, I have a table movies and a table users I'm trying to have an "Add to favs" button that a user can click, which will add that movie to his favorites (ajax / javascript not necessary at the moment, just php). So what's the simplest way I could do something like that? I've thought about this but I can't seem to...

Testing for color support in Linux shell scripts

This is the second time I've wanted to do this and again my google-fu has failed me. When in the course of running a shell script (in my case a bash script) is there a program/script that tests whether the current shell supports color? Alternatively is there a way to take the terminal type and easily determine if it supports color? Ei...

Perl: calling another_script.pl with parameters from script.pl and w/o system,backticks and modules

I have two scripts and two conf file (actually perl scripts too): conf1.pl @some_array = ({name =>"orange", deny = > "yes"}, {name =>"apple", deny = > "no"}); conf2.pl @some_array = ({name =>"male", deny = > "yes"}, {name =>"female", deny = > "no"}); script.pl #!/usr/bin/perl -w use strict; our %deny...

Incremetal backups of directories with a batch/shell script

I'm trying to create a script that will automatically backup a complete directory tree. I also want it to work for incremental backups. Basically, it wil work like this: If file is in both source and destination and they are different, source file will be copied If file is in both source and destination and they are the same, nothing w...

How to include an external plugin inside of another jQuery plugin being authored.

I am building a custom jQuery plugin for a project I am working on. I want to return an object that is custom to another jQuery plugin...rather than having to make sure that each page that uses my plugin also has this other plugin, is it possible to include it in the actual plugin itself? Rather than type the following on each page tha...

Make CharacterControllers in Unity not collide with each other

I'm trying to spawn a number of CharacterControllers and have them move around an area, but they keep getting stuck on each other. Is there a way to make them pass through each other while still respecting the terrain's obstructions? ...

Find and Replace a batch file using DOS

Hi This is what i need. Lets say there is a file temp.txt Lets say temp.txt has the following content : name=@name age=@age email=@email And my batch file create.bat should ask for the three parameters as input from the user, and then replace the temp.txt with the respective values. Say. Pls enter your name:Tom Tom - Confirm Y/N...