scripting

Suspending a PowerShell script until a action is complete i.e. opening & closing Notepad

Hi, Is there a way of suspending a PowerShell script until some action has been completed. For example if I was using a Linux shell and I typed gedit then gedit would load but the shell would be suspended until I closed gedit (unless '&' was added to the end of the command). Is there anyway to mimick this behaviour with PowerShell? So ...

How to debug an awk script

Hi, may i know the tips for debugging any awk script? Please feel free to share if you have any. Thanks ...

Generate script for all objects for SQL Server Database

I have used SMO objects to generate SQL Script for database objecrs for SQL Server. This works well when the database is in the local network. But it takes a lot of time if database is in a remote server. What would be the best and fastest way of generating scripts for SQL Server objects when database is in remote server. Thanks in adva...

date format in msbuild script?

In my msbuild script I'm creating a zip file with year/month/day in the zip filename, but month and day are always written with no leading zero. Is there a way to add leading zero to my zip filename? <Time> <Output TaskParameter="Year" PropertyName="Year" /> <Output TaskParameter="Month" PropertyName="Month" /> <Output TaskParame...

bash scripting challenge

Hi, I need to write a bash script that will iterate through the contents of a directory (including subdirectories) and perform the following replacements: replace 'foo' in any file names with 'bar' replace 'foo' in the contents of any files with 'bar' So far all I've got is find . -name '*' -exec {} \; :-) ...

Calling a python function from bash script

I have an "alarm email" function inside a python module. I want to be able to call this function from a bash script. I know you can call a module using 'python ' in the script, but I'm not if you can or how you would call a specific function within the module. ...

need help on implement a feature similiar to WScript.ConnectObject

I am working on adding scripting capability to my application. I have largely solved all the issues. Now I can expose my objects to scripts, and the script can handle events from my objects as well. As a step further I wish that the script is able to handle events fired from third party objects, in a way similar to WScript.ConnectObject....

PHP - Does session_unset unregister $_SESSION vars?

Does session_unset() unregister all the $_SESSION vars, or do you have to manually clear each variable registered into the $_SESSION array with unset() ? I'm confused about this because the PHP documentation says: Only use session_unset() for older deprecated code that does not use $_SESSION. If $_SESSION is used, use unset() ...

sc_trans metadataPattern

metadataPattern The pattern used to extract metadata from a file name if metadata does not exist or useMetadata == 0. default is /%N. for unix and \%N. for windows %N = song name %G = genre %A = album %R = artist %Y = four digit year %# = sequence of digits %% = % character [] = brackets option...

What is the definition of modular scripting in the FileMaker world?

How do you define modular scripting in the FileMaker context? I am not providing my definition yet on purpose. I want to know what you think. Thanks! ...

How to pass an arbitrary AppleScript Record to Cocoa in a scriptable app?

I have a Cocoa application with an AppleScript dictionary described in a .sdef XML file. All of the AppleScript classes, commands, etc. defined in the sdef are working property. Except for my "submit form" command. The "submit form" command is my only command attempting to pass a parameter that is an arbitrary hashtable of information f...

How to output awk result to file

Hi I am trying to output 'awk' result to file in my script, with no success. Using '>' does not work, why? for a in $(find $OUPUT_DIR/ -maxdepth 1 -mindepth 1 -type d -printf "%P\n") do echo $a is a directory awk -F, '{ if ($10 == '"$a"') print $0 }' $OUPUT_DIR/CDRNOutput_${CDR_DATE}.csv > $OUPUT_DIR/$a/CDR-${CDR_DATE}.csv done...

Run Java class file from PHP script on a website

I have a website and want to be able to allow the user to run a Java file on the server from the website. I want the user to click a button which will run the Java file on the server AND anything printed to standard-out by the Java program will be printed out on the website for the user to see. How can this be done (call Java program ...

How to make sh script the application for Mac OS

I wrote java application and i need to make it standalone for macos(.app). Earlier I used jar builder, but now i need to execute some shell script before java application starts. How can i do it? ...

facebook fbjs script dosent work with runat="server" attribute

hi, I am trying making facebook application with asp.net. My script code dosent run with form runat="server" attribute. I check with firebug and I am getting this error : XXX_form is null. my code : <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <script> function displayError(title, me...

Drupal Help - Warning: Unresponsive Script - Everytime Goes into or out of Block Edit Mode

Every time goes in and out admin-build-block page, the annoying "Warning: Unresponsive Script" pop-up shows up along with such details: A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete. Script: http://domain name/sites/default/files...

How do I execute a command from a specific directory without actually changing to that directory

I want to execute a command like 'git tag -l' inside a directory /home/user/git/app/ but I am actually in /home/user. How can I do that in bash without changing my working directory? So NOT: cd /home/user/git/app && git tag -l because that actually changes my working directory and have to do 'cd /home/user' again. ...

How to simulate the environment cron executes a script with?

I normally have several problems with how cron executes scripts as they normally don't have my environment setup. Is there a way to invoke bash(?) in the same way cron does so I could test scripts before installing them? ...

Bash for loop with wildcards and hidden files

Just witting a simple shell script and little confused: Here is my script: % for f in $FILES; do echo "Processing $f file.."; done The Command: ls -la | grep bash produces: % ls -a | grep bash .bash_from_cshrc .bash_history .bash_profile .bashrc When FILES=".bash*" I get the same results (different formatting) as ls -a. ...

Portable scripting language for a multi-server admin?

Please Note: Portable as in portableapps.com, not in the traditional sense of a language that can be used on multiple architectures or operating systems. Whoever coined this usage of the word portable should be whacked. :) I'm a DBA and sysadmin, mostly for Windows machines running SQL Server. I'm looking for a programming/scripting lan...