Search Results

Search found 9122 results on 365 pages for 'dynamic scripting'.

Page 9/365 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • patterns in case statement in bash scripting

    - by Ramiro Rela
    The man says that case statements use "filename expansion pattern matching". I usually want to have short names for some parameters, so I go: case $1 in req|reqs|requirements) TASK="Functional Requirements";; met|meet|meetings) TASK="Meetings with the client";; esac logTimeSpentIn "$TASK" I tried patterns like "req*" or "me{e,}t" which I understand would expand correctly to match those values in the context of filename expansion, but it doesn't work. Thanks.

    Read the article

  • Shell scripting and test expressions

    - by Paul
    Hi, I'm trying to test whether a directory path exists when a file is passed to my script. I use dirname to strip and save the path. I want my script to run only if the path exists. This is my attempt below. FILE=$1 DIRNAME=dirname $FILE if [ -z $DIRNAME ] ; then echo "Error no file path" exit 1 fi But this doesn't work. Actual when there is no file path dirname $FILE still returns "." to DIRNAME, i.e. this directory. So how do i distinguish between "." and "/bla/bla/bla". Thanks.

    Read the article

  • shell scripting error logging

    - by Eddy
    Hi all, I'm trying to setup a simple logging framework in my shell scripts. For this I'd like to define a "log" function callable as log "LEVEL" $message Where the message is a variable to which I have previously redirected the outputs of executed commands. My trouble is that I get errors with the following {message=command 2&3 1&3 3&-} &3 log "INFO" $message There's something wrong isn't there? TIA

    Read the article

  • Shell Scripting: Generating output file name in script and then writing to it

    - by NewShellScripter
    Hello, I have a shell script where a user passes different sizes as command line arguments. For each of those sizes, I want to perform some task, then save the output of that task into a .txt file with the size in the name. How can I take the command line passed and make that part of a stringname for the output file? I save the output file in a directory specified by another command line argument. Perhaps an example will clear it up. In the foor lop, the i value represents the command line argument I need to use, but $$i doesnt work. ./runMe arg1 arg2 outputDir [size1 size2 size3...] for ((i=4; i<$#; i++ )) do ping -s $$i google.com >> $outputDir/$$iresults.txt done I need to know how to build the $outputDir/$$iresults.txt string. Also, the ping -s $$i doesnt work. Its like I need two levels of replacement. I need to replace the $[$i] inner $i with the value in the loop, like 4 for ex, making it $4. Then replace $4 with the 4th command line argument! Any help would be greatly appreciated. Thanks!

    Read the article

  • How to close all tabs in Safari using AppleScript?

    - by Form
    I have made a very simple AppleScript to close all tabs in Safari. The problem is, it works, but not completely. Here's the code: tell application "Safari" repeat with aWindow in windows repeat with aTab in tabs of aWindow aTab close end repeat end repeat end tell I've also tried this script: tell application "Safari" repeat with i from 0 to the number of items in windows set aWindow to item i of windows repeat with j from 0 to the number of tabs in aWindow set aTab to item j of tabs of aWindow aTab close end repeat end repeat end tell ... but it does not work either. I tried that on my system (MacBook Pro jan 2008), as well as on a Mac Pro G5 under Tiger and the script fails on both, albeit with a much less descriptive error on Tiger. The problem is that only a couple of tabs are closed. Running the script a few times closes a few tab each time until none is left, but always fails with the same error after closing a few tabs. Under Leopard I get an out of bounds error. Since I am using fast enumeration (not using "repeat from 0 to number of items in windows") I don't see how I can get an out of bounds error with this... My goal is to use the Cocoa Scripting Bridge to close tabs in Safari from my Objective-C Cocoa application but the Scripting Bridge fails in the same manner. The non-deletable tabs show as NULL in the Xcode debugger, while the other tabs are valid objects from which I can get values back (such as their title). In fact I tried with the Scripting Bridge first then told myself why not try this directly in AppleScript and I was surprised to see the same results. I must have a glaring omission or something in there... (seems like a bug in Safari AppleScript support to me... :S) I've used repeat loops and Obj-C 2.0 fast enumeration to iterate through collections before with zero problems, so I really don't see what's wrong here. Anyone can help? Thanks in advance!

    Read the article

  • Can I have both Windows dynamic disk partition and some other non-Windows partition on the same disk?

    - by haimg
    When a basic Windows disk is converted to dynamic, Windows creates a partition that span the whole disk with the type of "Windows LVM" and manages its dynamic partitions within this space. So even if there is still free space on this disk, it is not visible to any other OS besides Windows. This happens with MBR and GPT disks both. I would like to share a Windows dynamic disk with some other OS. I have to have dynamic disks because I use Windows SoftRaid (mirrors). So, my questions are: Is there any way to "force" Windows to take up less then the whole disk when it converts a basic disk to dynamic? Will Windows tolerate having some other non-Windows partition on its dynamic disk?

    Read the article

  • Can't activate dynamic disk

    - by SuperFurryToad
    For some reason I can't activate a dynamic disk connected to my PC via a USB hard disk enclosure. It has activated previously without any problems. When I check the event logs, I get this message every time I try to activate the disk: dmio: Harddisk2 write error at block 2930277167: status 0xc0000015

    Read the article

  • Dynamic DNS with Comcast

    - by colithium
    I've just recently moved across town. Previously, I had Dynamic DNS set up so I could remotely connect to my desktop (primarily to use TightVNC). My ISP was Comcast and I'm in the Denver, Colorado area. Currently, I'm still with Comcast and still in Denver. My router connects to the internet just fine and my Dynamic DNS record over at DynDNS did get updated with my router's current external IP address. So my router, DynDNS, and public DNS records all agree what my IP address is. However, I can't actually connect to anything from the outside world. My trace route to Google looks something like: Tracing route to google.com [74.125.19.147] 1 3 ms 1 ms 1 ms 192.168.1.1 (this is the internal IP address of my router) 2 * * * Request timed out. 3 9 ms 8 ms 10 ms te-8-2-ur02.wheatridge.co.denver.comcast.net [68.85.221.177] 4 12 ms 12 ms 19 ms te-0-8-0-2-ar02.aurora.co.denver.comcast.net [68.86.103.97] 5 16 ms 13 ms 11 ms pos-0-3-0-0-cr01.denver.co.ibone.comcast.net [68.86.91.1] 6 28 ms 28 ms 27 ms pos-0-9-0-0-cr01.dallas.tx.ibone.comcast.net [68.86.85.174] 7 29 ms 27 ms 28 ms pos-0-1-0-0-pe01.1950stemmons.tx.ibone.comcast.net [68.86.86.94] 8 66 ms 108 ms * 75.149.231.70 9 65 ms 68 ms 93 ms 72.14.233.77 10 67 ms 66 ms 66 ms 72.14.233.111 11 67 ms 67 ms 69 ms 216.239.43.144 12 68 ms 71 ms 73 ms 209.85.249.30 13 66 ms 66 ms 68 ms nuq04s01-in-f147.1e100.net [74.125.19.147] This is what the trace route looks like from an outside source to my DynDNS domain name: traceroute to 98.245.67.65 (98.245.67.65) 1 illuminati-130 138.67.130.61 2 138.67.63.253 138.67.63.253 3 vermiculite 138.67.253.20 4 csm-ct-gw 138.67.253.244 5 138.67.253.2 138.67.253.2 6 ge-7-24-ar01.denver.co.denver.comcast.net 68.86.128.17 7 te-0-4-0-0-ar02.denver.co.denver.comcast.net 68.86.179.21 8 te-9-3-ur01.wheatridge.co.denver.comcast.net 68.86.103.18 9 * * * {Times Out} Now my guess is, whatever is sitting just beyond my router (what the modem connects to) is gumming things up. Even though the routes aren't EXACTLY the same, that appears to be the spot that the trace route either stops or doesn't get a response. My question is, for Comcast networks (particularly in Denver), what would be the device that typically sits there? Is there anything I can do about it? That device seems to not respond to PING but does forward it along when I'm going outwards. But it looks like it eats it when the request is coming in. It's hard to prove that from these logs but I'm assuming that's the case because my router used to accept connections from the outside and I haven't changed anything on it.

    Read the article

  • Dynamic Disk Start on Boot

    - by Xiuhtecuhtli
    Is there a way to make a Dynamic Disc Automatically Come on line after a reboot. at the moment i must manually Bring the disk "online". I was thinking a Startup Script would do the trick. does anyone know of a URL HOWTO or a Premade script to do this?

    Read the article

  • Using dynamic dns updater as Windows service

    - by Sami-L
    Currently I am using a dynamic dns updater software on Windows, but to keep it updating I have not to close it, also the software is not able to run at backgoud, I searched on google but the answer became complicated since there are many details to pay attention to, free, not free, installed on machine, configured on router, trusted, not trusted ... So please help me find a trusted free dns updater for Windows which can run as service, and maybe which can send email when update fails.

    Read the article

  • Recover data from a Windows Dynamic Volume Spanned Disk

    - by iCe
    I have a dynamic volume created with two spanned partitions over two disk. Recently, one disk has started failing, and I want to copy the data inside that disk to another disk, before replacing it. However I don't know how to select only what is inside the failing disk, because the partitions spans across both disks. Maybe imaging the entire disk should do the work? Or I have to copy all the data from both disks? Thanks in advance!

    Read the article

  • SQL Like keyword in Dynamic Linq

    - by Erwin
    Hi fellow programmer I want to use SQL's Like keyword in dynamic LINQ. The query that I want to make is like this select * from table_a where column_a like '%search%' Where the column_a can be dynamically changed to other column etc In this dynamic LINQ var result = db.table_a.Where( a=> (a.column_a.Contains("search")) ); But the column can't be dynamically changed , only the search key can How do we create a dynamic LINQ like var result = db.table_a.Where("column_a == \"search\""); That we can change the column and the search key dynamically

    Read the article

  • A function's static and dynamic parent

    - by legends2k
    I'm reading Thinking in C++ (vol. 2): Whenever a function is called, information about that function is pushed onto the runtime stack in an activation record instance (ARI), also called a stack frame. A typical stack frame contains (1) the address of the calling function (so execution can return to it), (2) a pointer to the ARI of the function’s static parent (the scope that lexically contains the called function, so variables global to the function can be accessed), and (3) a pointer to the function that called it (its dynamic parent). The path that logically results from repetitively following the dynamic parent links is the dynamic chain, or call chain I'm unable to comprehend what the author means as function's static and dynamic parent. Also am not able to differentiate between item 1, 2 or 3. They all seem to be the same. Can someone please explain this passage to me?

    Read the article

  • Getting results in a result set from dynamic SQL in Oracle

    - by msorens
    This question is similar to a couple others I have found on StackOverflow, but the differences are signficant enough to me to warrant a new question, so here it is: I want to obtain a result set from dynamic SQL in Oracle and then display it as a result set in a SqlDeveloper-like tool, just as if I had executed the dynamic SQL statement directly. This is straightforward in SQL Server, so to be concrete, here is an example from SQL Server that returns a result set in SQL Server Management Studio or Query Explorer: EXEC sp_executesql N'select * from countries' Or more properly: DECLARE @stmt nvarchar(100) SET @stmt = N'select * from countries' EXEC sp_executesql @stmt The question "How to return a resultset / cursor from a Oracle PL/SQL anonymous block that executes Dynamic SQL?" addresses the first half of the problem--executing dynamic SQL into a cursor. The question "How to make Oracle procedure return result sets" provides a similar answer. Web search has revealed many variations of the same theme, all addressing just the first half of my question. I found this post explaining how to do it in SqlDeveloper, but that uses a bit of functionality of SqlDeveloper. I am actually using a custom query tool so I need the solution to be self-contained in the SQL code. This custom query tool similarly does not have the capability to show output of print (dbms_output.put_line) statements; it only displays result sets. Here is yet one more possible avenue using 'execute immediate...bulk collect', but this example again renders the results with a loop of dbms_output.put_line statements. This link attempts to address the topic but the question never quite got answered there either. Assuming this is possible, I will add one more condition: I would like to do this without having to define a function or procedure (due to limited DB permissions). That is, I would like to execute a self-contained PL/SQL block containing dynamic SQL and return a result set in SqlDeveloper or a similar tool. So to summarize: I want to execute an arbitrary SQL statement (hence dynamic SQL). The platform is Oracle. The solution must be a PL/SQL block with no procedures or functions. The output must be generated as a canonical result set; no print statements. The output must render as a result set in SqlDeveloper without using any SqlDeveloper special functionality. Any suggestions?

    Read the article

  • Dependecy Injection with Massive ORM: dynamic trouble

    - by Sergi Papaseit
    I've started working on an MVC 3 project that needs data from an enormous existing database. My first idea was to go ahead and use EF 4.1 and create a bunch of POCO's to represent the tables I need, but I'm starting to think the mapping will get overly complicated as I only need some of the columns in some of the tables. (thanks to Steven for the clarification in the comments. So I thought I'd give Massive ORM a try. I normally use a Unit of Work implementation so I can keep everything nicely decoupled and can use Dependency Injection. This is part of what I have for Massive: public interface ISession { DynamicModel CreateTable<T>() where T : DynamicModel, new(); dynamic Single<T>(string where, params object[] args) where T : DynamicModel, new(); dynamic Single<T>(object key, string columns = "*") where T : DynamicModel, new(); // Some more methods supported by Massive here } And here's my implementation of the above interface: public class MassiveSession : ISession { public DynamicModel CreateTable<T>() where T : DynamicModel, new() { return new T(); } public dynamic Single<T>(string where, params object[] args) where T: DynamicModel, new() { var table = CreateTable<T>(); return table.Single(where, args); } public dynamic Single<T>(object key, string columns = "*") where T: DynamicModel, new() { var table = CreateTable<T>(); return table.Single(key, columns); } } The problem comes with the First(), Last() and FindBy() methods. Massive is based around a dynamic object called DynamicModel and doesn't define any of the above method; it handles them through a TryInvokeMethod() implementation overriden from DynamicObject instead: public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result) { } I'm at a loss on how to "interface" those methods in my ISession. How could my ISession provide support for First(), Last() and FindBy()? Put it another way, how can I use all of Massive's capabilities and still be able to decouple my classes from data access?

    Read the article

  • C# Dynamic Query Without A Database Model

    - by hitopp
    I have been searching the web for a solution to dynamic queries. I have found many different solutions (e.g. Linq to Sql, Dynamic Linq Expressions, Dynamic Query), but all of these solutions involve some sort of previous knowledge of the database (like a model in code). Maybe what I am asking is way off the deep end, but is there any possible way to dynamically query a database without a model? For example, a database has a Customers table with the following columns: CustomerID Name FavoriteColor I want to create a query as SELECT Name FROM Customers WHERE @0 = @1, where the two placeholders are populated dynamically. The resulting data does not tie to a model class and I would prefer to use some sort of framework to build the queries, not simple string concatenation. The System.Linq.Dynamic namespace came really close to fulfilling this request, but it uses a database model. I realize this is crazy, but I was just curious.

    Read the article

  • New article available in "SOA Suite Essentials for WLI Users" series: Dynamic Data Lookup in a Busin

    - by simone.geib
    It is my pleasure to announce the publishing of another article in our "SOA Suite Essentials for WLI Users" series: "Dynamic Data Lookup in a Business Process: Meta Data Cache Control in Oracle WebLogic Integration and Domain Value Maps in SOA Suite". This article explains how dynamic data can be retrieved in a business process using Domain Value Maps in SOA Suite and shows the similarities to the WLI XML MetaData Cache Control. Lots of customers have asked about this comparison and I hope they will find it useful. The article follows "Setting Web Service and JCA Adapter Endpoints Dynamically in Oracle SOA Suite" which describes how web services and JCA adapter endpoints in SOA Suite can be changed at run-time, and so completes the use case where a BPEL process writes to a file (via file adapter) and the output directory and the file name are set dynamically. Please let me know what you think about the series and this specific article.

    Read the article

  • How to mock a dynamic object

    - by Daniel Cazzulino
    Someone asked me how to mock a dynamic object with Moq, which might be non-obvious. Given the following interface definition: public interface IProject { string Name { get; } dynamic Data { get; } } When you try to setup the mock for the dynamic property values, you get:   What’s important to realize is that a dynamic object is just a plain object, whose properties happen to be resolved at runtime. Kinda like reflection, if you will: all public properties of whatever object happens to be the instance, will be resolved just fine at runtime. Therefore, one way to mock this dynamic is to just create an anonymous type with the properties we want, and set the dynamic property to return that:...Read full article

    Read the article

  • skipping a variable using while read in bash

    - by Aleksandar Ivanisevic
    i'm reading a few variables from a file using while read a b c; do (something) done < filename is there an elegant way to skip a variable (read in an empty value), i.e. if I want a=1 b= c=3, what should I write in the file? Right now i'm putting 1 "" 3 and then use b=$(echo $b | tr -d \" ) but this is pretty cumbersome, IMHO any ideas?

    Read the article

  • Redirecting program errors to both log and error file

    - by Gnanam
    I've a Java standalone program scheduled to run as cron at every 10 minutes I want to catch/write errors thrown by this Java program both in the log file and also as a separate error file (MyJavaStandalone.err). I know the following commands: Errors redirected to a separate file but not to log file /usr/java/jdk1.6.0/bin/java MyJavaStandalone >> MyJavaStandalone.log 2>> MyJavaStandalone.err & Both log and errors are redirected to the same log file, but errors alone are not written to a separate error file /usr/java/jdk1.6.0/bin/java MyJavaStandalone >> MyJavaStandalone.log 2>&1 &

    Read the article

  • Year Month day from file name in shell script

    - by user3319390
    I hava file names like below adn_DF9D_20140515_0001.log adn_DF9D_20140515_0002.log adn_DF9D_20140515_0003.log adn_DF9D_20140515_0004.log adn_DF9D_20140515_0005.log adn_DF9D_20140515_0006.log adn_DF9D_20140515_0007.log i want get the year, Month, day from file name and create directories Ex: [[ ! -d "$BASE_DIR/$year/$month/$day" ]] && mkdir -p "$BASE_DIR/$year/$month/$day"; How to achieve this and share the ideas/ script appreciate to you

    Read the article

  • Linux script to find time difference and send an email if need

    - by Gnanam
    Hi, I'm not an expert in writing shell scripts but also I'm looking for a very specific solution. OS: CentOS release 5.2 (Final) I've a Java standalone which keeps writing (all System.out.println) to a log file. For some unknown reason, this Java standalone stops working at some point of time in my server and eventually logs writing also stops working. I want to have a script which checks the last modified date & time of the log file with current date & time in the server. If the time difference exceeds more than 5 minutes, I want to send an email immediately to my recipients list. This way I'll come to know when this Java standalone has stopped working. I'll move this script to crontab and make it run for every 1 minute, so that this whole process is automated. Log file location: /usr/local/logs/standalone.log

    Read the article

  • Check a list of passwords strength

    - by user144705
    Is there any way to check a list of passwords whether they strong or not? I have a list of passwords, around 2000, and want to check them against this policy Password must contain a minimum of eight (8) characters Password must contain at least one letter Password must contain at least one number Password must contain at least one punctuation character And count how many compliant with that policy before we save them. Is there any tool, script or maybe rules in excel to do this instead of doing it manually? Could you please help me?

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >