scripting

Bash script does not continue to read the next line of file

Hello all, I have a shell script that saves the output of a command that is executed to a CSV file. It reads the command it has to execute from a shell script which is in this format: ffmpeg -i /home/test/videos/avi/418kb.avi /home/test/videos/done/418kb.flv ffmpeg -i /home/test/videos/avi/1253kb.avi /home/test/videos/done/1253kb.flv f...

problem reading args from batch script

On windows, I'm trying to acquire the file name using the %~f1 parameter. I'm doing this from a new voice (command) which I've added to the contextual menu. In the windows registry, the voice simply calls a batch script which prints the file name, by this way: `C:\script.bat %~f1` but I get this output: `C:\Documents and Setting...

Why is this groovy code throwing a MultipleCompilationErrorsException ?

I have the following groovy code : class FileWalker { private String dir public static void onEachFile(String dir,IAction ia) { new File(dir).eachFileRecurse { ia.perform(it) } } } walker = new FileWalker() walker.onEachFile(args[0],new PrintAction()) I noticed that if I place a def in front of walker , ...

Delete files from disk that aren't in a Visual Studio project

Can anyone think of a way (perhaps using a PowerShell script or similar) where I can look for *.cs files that are on disk in the folder structure, but aren't included in a project file? This has come about gradually over time with merging in Subversion etc. I'm looking for a way to clean up after myself, basically. :) ...

Escaping Double Quotes in Batch Script

How would I go about replacing all of the double quotes in my batch file's parameters with escaped double quotes? This is my current batch file, which expands all of its command line parameters inside the string: @echo off call bash --verbose -c "g++-linux-4.1 %*" It then uses that string to make a call to Cygwin's bash, executing a L...

How to identify users which are connected to a windows server via remote desktop

At my workplace, we have lab machines that we use to do our testing. The standard procedure to reserve a machine for testing was to walk around the office to make sure that no one was using the machine. This is highly inefficient and time consuming. At first, I set up a web page where people could reserve the lab machine but nobody...

script to map network drive

I want to be able to connect to a (wifi) network hard drive from my laptop, but only occasionally. If I use the "Map a network drive" command in WinXP explorer, I have to put in the drive's IP address and name, then the router name and its password. Too much to remember! I'm looking for a way of scripting this activity (in any language)...

How do I identify what branches exist in CVS?

I have a legacy CVS repository which shall be migrated to Perforce. For each module, I need to identify what branches exist in that module. I just want a list of branch names, no tags. It must be a command line tool, for scripting reasons. For example (assuming there is a cvs-list-branches.sh script): $ ./cvs-list-branches.sh module1...

How can I tail a remote file?

I am trying to find a good way to tail a file on a remote host. This is on an internal network of Linux machines. The requirements are: Must be well behaved (no extra process laying around, or continuing output) Cannot require someone's pet Perl module. Can be invoked through Perl. If possible, doesn't require a custom built script o...

Move lines from one .txt file to another

I am trying to move certain lines from one .txt file to another. These lines all follow a certain pattern. I have been looking at using the find command in a batch file, but this does not delete the line from the original file. For example: find \i pattern "d:\example1.txt" >> "d:\example2.txt" Is there any way to achieve this? Th...

Can I use perl's switches with /bin/env in the shebang line?

I want to run perl -w using env. That works fine on the command line: $ /bin/env perl -we 'print "Hello, world!\n"' Hello, world! But it doesn't work on the shebang line in a script: #!/bin/env perl -w print "Hello, world!\n"; Here is the error: /bin/env: perl -w: No such file or directory Apparently env doesn't understand the -...

How to remove System.out.println's from codebase

We have a huge (old legacy java) code-base, where many files (around 5k) have System.out.println's. We are planning to remove them for cleanup/performance reasons. How can we write a script that will replace them without introducing any issues in the code? The script cannot blindly delete them as following case can be an issue: if () ...

Where do you need scripting in browsers?

Browsers, like Elinks, support scripting. Where do you need it? [Clarification] I meant where users need to do their own scripts. It must do something with data manipulation and extraction. Can scripts help me to become faster? ...

SSIS - read a single header record from a flat file or an excel file prior to processing

Is there a method where by one can read just the first record of a file; i.e to read header information, so that a decision can be made whther or not to process the remainder of the file ? I know that with the split transformation component one can write an expression that will ignore all of the rows besides the header, based on a key wo...

I'd like to scrape the iTunes top X RSS feed and insert into a dB...

Preferably I'd like to do so with some bash shell scripting, maybe some PHP or PERL and a MySQL db. Thoughts? ...

Shell script datetime function?

I am running the following script: #!/bin/ksh ./clear_old ./rooms_xls.pl 2/23/09 cd doors ./doors_xls.pl 2/23/09 How can I get the date to be today's date based upon the system/server time? ...

Begin Lua-scripting

I'm at a stage where I am forced to learn Lua, so do you have any suggestions on how I do this? I don't have a lot of experience with any other scripting languages than PHP. So, some suggestions on "head start lua"-pages? EDIT As an addition to the wonderful tutorial pages, could you plaese suggest any "programs" I could make that wil...

How is the memory allocation done for variables in scripting languages?

For example, in javascript I can say var x = 5; Later I can do x = 'a'; and then x = "hello"; So, how is memory allocated for the variables? As it is, all variables have a common type 'var' and values of variables can change at run-time as seen above. Isn't it a difficult task to allocate and manage memory for these variables?...

Need to monitor directory change, and perform action

1st of all: I'm not programmer, neither Linux guru, just have to work with Linux, Oracle, shell scripts. My current task is to monitor a table in Oracle (tool: sqlplus), and if it contains a certain row, then watch a linux directory for a growing tmp file, and log its attributes (e.g. ls -l), in every 5 second. The most important part...

I need to generate bookmarks in word 2003 programaticaly based on locations denoted by section number.

I have an HTML page with links that when clicked open to a specific bookmark in a word document. I am working with an existing word 2003 document with no preexisting bookmarks. I want to add bookmarks to all section number header locations using a macro or a VBA script . Example 3.1.4.2 HERE STUFF 3.1.4.2.1 Here again ...