Search Results

Search found 10789 results on 432 pages for 'ui scripting'.

Page 110/432 | < Previous Page | 106 107 108 109 110 111 112 113 114 115 116 117  | Next Page >

  • shell script segment to avoid overwriting files

    - by johndashen
    I have a perl script (or any executable) E which will take a file foo.xml and write a file foo.txt. I use a Beowulf cluster to run E for a large number of XML files, but I'd like to write a simple job server script in shell (bash) which doesn't overwrite existing txt files. I'm currently doing something like #!/bin/sh PATTERN="[A-Z]*0[1-2][a-j]"; # this matches foo in all cases todo=`ls *.xml | grep $PATTERN`; isdone=`ls *.foo | grep $PATTERN`; whatsleft=todo - isdone; # what's the unix magic? #and then call the job server; jobserve E "$whatsleft"; and then I don't know how to get the difference between $todo and $isdone. I'd prefer using sort/uniq to something like a for loop with grep inside, but I'm not sure how to do it (pipes? temporary files?) As a bonus question, is there a way to do lookahead search in bash grep?

    Read the article

  • Unable to parse variable length string separated by delimiter

    - by Technext
    Hi, I have a problem with parsing a string, which consists only of directory path. For ex. My input string is Abc\Program Files\sample\ My output should be Abc//Program Files//sample The script should work for input path of any length i.e., it can contain any no. of subdirectories. (For ex., abc\temp\sample\folder\joe) I have looked for help in many links but to no avail. Looks like FOR command extracts only one whole line or a string (when we use ‘token’ keyword in FOR syntax) but my problem is that I am not aware of the input path length and hence, the no. of tokens. My idea was to use \ as a delimiter and then extract each word before and after it (), and put the words to an output file along with // till we reach the end of the string. I tried implementing the following but it did not work: @echo off FOR /F "delims=\" %%x in (orig.txt) do ( IF NOT %%x == "" echo.%%x//output.txt ) The file orig.txt contains only one line i.e, Abc\Program Files\sample\ The output that I get contains only: Abc// The above output contains blank spaces as well after ‘Abc//’ My desired output should be: Abc//program Files//sample// Can anyone please help me with this? Regards, Technext

    Read the article

  • ASP.NET MVC 2 project default script files. What do you use?

    - by Andrew Florko
    Many js files are included into Scripts folder by default in ASP.NET MVC 2 Projects. I suppose developers use jquery library nearly every time they program a site, but what about other files? Please, can you tell scenarios and reasons when you: Use Microsoft.Ajax instead of jquery or mix both libraries? Do you use JQuery validation infrastructure instead of asp.net mvc one, or combine them both? Thank you in advance! P.S. there are also diferrent editions of the same file. Do you include different editions depenending on debug/release build?

    Read the article

  • Possible to lock attribute write access by Doors User?

    - by Philip Nguyen
    Is it possible to programmatically lock certain attributes based on the user? So certain attributes can be written to by User2 and certain attributes cannot be written to by User2. However, User1 may have write access to all attributes. What is the most efficient way of accomplishing this? I have to worry about not taking up too many computational resources, as I would like this to be able to work on quite large modules.

    Read the article

  • Python - open text file, but specify name when executing command

    - by Dunnolol
    I have a directory of text files that all end in the extension .txt My goal is to print the contents of the text file. I wish to be able use the wildcard *.txt to be able to specific the text file name I wish to open (I'm thinking along the lines of something like "F:\text*.txt" ?), split the lines of the text file, then print the output. Here is an example of what I want to do, but I want to be able to change "somefile" when executing my command. f = open('F:\text\somefile.txt', 'r') for line in f: print line,

    Read the article

  • How to store the hostname in a variable in a .bat file?

    - by eqbridges
    I would like to convert this /bin/sh syntax into a widely compatible Windows batch script: host=`hostname` echo ${host} How to do this so that it'll work on any Windows Vista, Windows XP, and Windows 2000 machine? To clarify: I would then like to go on in the program and use the hostname as stored in the variable host. In other words, the larger goal of the program is not to simply echo the hostname.

    Read the article

  • JavaScript Drag and Drop Grid With Elements of Different Sizes.

    - by Paul67
    I need to be able to drag and drop boxes of differing dimensions on the same grid. JQuery UI seems to offer 80% of what I'm after particularly the sortable grid the have on their demo page. The only problem is that this grid only works with boxes of identical dimensions. My requirement is to be able to have the same functionality but with boxes that are sized as multiples of the base unit. For example - let's say the standard box size is 300x300px I would also like the opportunity to show on the same grid a 300x600px and a 600x600px box. There's no requirement to display boxes that are not multiples of the dimensions of the smallest box size.

    Read the article

  • Bash command that prints a message on stderr

    - by Salman A
    I want to know if there is a built-in BASH command that prints some text on stderr, just like the echo command that prints text on stdout. I don't want to use temporary io-redirection. I use a built-in command to generate an error on stderr such as ls --asdf (ls: unrecognized option '--asdf') but I want something neater,

    Read the article

  • jQuery + Simple Dialog

    - by Panther24
    Hi, I have a jQuery Model windows which contains a form. On creating of the page, I'm able to see the fields although in my dialog, i have set autoOpen to false. All the forms are in a div. a sample of my dialog looks like this: $("#dialog-form").dialog({ autoOpen: false, height: 460, width: 750, modal: true, buttons: { 'Create Map': function() { document.registerFrm.submit(); }, Cancel: function() { $(this).dialog('close'); } }, close: function() { allFields.val('').removeClass('ui-state-error'); } }); Any way to resolve, I don't want the form fields to be visible on load/creation of the page.

    Read the article

  • script to delete all /n number of lines starting from a word except last line

    - by akvikram
    how to delete all lines below a word except last line in a file. suppose i have a file which contains | 02/04/2010 07:24:20 | 20-24 | 26 | 13 | 2.60 | | 02/04/2010 07:24:25 | 25-29 | 6 | 3 | 0.60 | +---------------------+-------+------------+----------+-------------+ 02-04-2010-07:24 --- ER GW 03 +---------------------+-------+------------+----------+-------------+ | date | sec | BOTH_MO_MT | MO_or_MT | TPS_PER_SEC | +---------------------+-------+------------+----------+-------------+ | 02/04/2010 07:00:00 | 00-04 | 28 | 14 | 2.80 | | 02/04/2010 07:00:05 | 05-09 | 27 | 14 | 2.70 | ... ... ... ... END OF TPS PER 5 REPORT and i need to delete all contents from "02-04-2010-07:24 --- ER GW 03" except "END OF TPS PER 5 REPORT" and save the file. This has to be done for around 700 files. all files are same format, with datemonthday filename.

    Read the article

  • symlink files newer than X age, then later remove symlink once file ages?

    - by bleomycin
    Hello everyone, i have a large number of files/folders coming in each day that are being sorted automatically to a wide variety of folders. I'm looking for a way to automatically find these files/folders and create symlinks to them all within an "incoming" folder. Searching for file age should be sufficient for finding the files, however searching for age and owner would be ideal. Then once the files/folders being linked to reach a certain age, say 5 days, remove the symlinks to them automatically from the "incoming" folder. Is this possible to do with a simple shell or python script that can be run with cron? Thanks!

    Read the article

  • Parsing result of Diff in Shell Script

    - by Saobi
    I want to compare two files and see if they are the same or not in my shell script, my way is: diff_output=`diff ${dest_file} ${source_file}` if [ some_other_condition -o ${diff_output} -o some_other_condition2 ] then .... fi Basically, if they are the same ${diff_output} should contain nothing and the above test would evaluate to true. But when I run my script, it says [: too many arguments On the if [....] line. Any ideas?

    Read the article

  • Passing CMD Results to Variable in a Batch File

    - by TripleNad
    I am trying to install an application and a group of services using PSTools, but I want to take into account that the computer I am trying to connect to may be turned off or on a different network, which is not reachable from the internal network. Basically if the machine is not able to be accessed through the admin share, this is the message that I am getting: Couldn't access MachineName: The network path was not found. Make sure that the default admin$ share is enabled on MachineName. This is the syntax I am using to try to capture the "Error Message" and then report back that if installation was successful or not (depending on if it can contact the machine) @echo off set /p name=What is the machine name?: psexec.exe \\\%name% -u *useraccount* -p *password* \\\ServerName\installation.bat FOR /F "tokens=*" %%A IN ('COMMAND ^| FIND "Couldn't access"') DO SET Error=%%A If "%Error%"=="Couldn't access" ECHO Installation Failed. Else ECHO Installtion complete. Pause exit Currently it hangs right at the point it's defining the Error Variable. Can't quite figure out what I am going wrong here.

    Read the article

  • Restrict characters used in a string

    - by Jeremy Rudd
    How do I restrict a string to whitelisted characters? // "HOW am I to understand; this is, BAD" $str = restrictTo($str,"0-9a-z,. "); // " am I to understand this is, " Is there an inbuilt function in PHP that does something close? I can't formulate a regular expression for this though :(

    Read the article

  • Can I use GNU Screen completely transparently/automatically?

    - by dreeves
    Screen is amazing, of course, but I don't want to have to think about it. I often ssh to a machine, start doing a bunch of stuff, and then think "gosh, I wish I had thought to start a screen session before doing all that so I could reconnect to this from home later". I'd like to have screen automatically started whenever I log in to a machine. And when I get disconnected, I want to be able to immediately and simply reconnect without fussing with "screen -ls" and "screen -dr". I have a script that implements one solution to this problem which I'll post as an answer. I'm interested to see other approaches.

    Read the article

  • How do I convert filenames from unicode to ascii

    - by zedwarth
    I have a bunch of music files on a NTFS partition mounted on linux that have filenames with unicode characters. I'm having trouble writing a script to rename the files so that all of the file names use only ASCII characters. I think that using the iconv command should work, but I'm having trouble escaping the characters for the mv command.

    Read the article

  • Run C or C++ file as a script

    - by Brendan Long
    So this is probably a long shot, but is there any way to run a C or C++ file as a script? I tried: #!/usr/bin/gcc main.c -o main; ./main int main(){ return 0; } But it says: ./main.c:1:2: error: invalid preprocessing directive #!

    Read the article

  • How can I use git to stage only one line in a file for commit, all from a script?

    - by Sandy
    I'm writing a simple pre-commit git hook that updates the year in copyright headers for files that are staged for commit. After modifying the line with the copyright, I would like the hook to stage that line so that it is part of the commit. It can't just git add the whole file, because there may be other pre-existing changes in there that shouldn't be staged. I don't see any options in the git add manual the let you stage specific lines. I figure I could git stash save --keep-index, apply my change, git add the file, and then git stash pop, but that seems rather crude. Any better approaches?

    Read the article

  • Pipelining String in Powershell

    - by ChvyVele
    I'm trying to make a simple PowerShell function to have a Linux-style ssh command. Such as: ssh username@url I'm using plink to do this, and this is the function I have written: function ssh { param($usernameAndServer) $myArray = $usernameAndServer.Split("@") $myArray[0] | C:\plink.exe -ssh $myArray[1] } If entered correctly by the user, $myArray[0] is the username and $myArray[1] is the URL. Thus, it connects to the URL and when you're prompted for a username, the username is streamed in using the pipeline. Everything works perfectly, except the pipeline keeps feeding the username ($myArray[0]) and it is entered as the password over and over. Example: PS C:\Users\Mike> ssh xxxxx@yyyyy login as: xxxxx@yyyyy's password: Access denied xxxxx@yyyyy's password: Access denied xxxxx@yyyyy's password: Access denied xxxxx@yyyyy's password: Access denied xxxxx@yyyy's password: Access denied xxxxx@yyyyy's password: FATAL ERROR: Server sent disconnect message type 2 (protocol error): "Too many authentication failures for xxxxx" Where the username has been substituted with xxxxx and the URL has been substituted with yyyyy. Basically, I need to find out how to stop the script from piping in the username ($myArray[0]) after it has been entered once. Any ideas? I've looked all over the internet for a solution and haven't found anything.

    Read the article

  • How do I call Matlab in a script on Windows?

    - by Benjamin Oakes
    I'm working on a project that uses several languages: SQL for querying a database Perl/Ruby for quick-and-dirty processing of the data from the database and some other bookkeeping Matlab for matrix-oriented computations Various statistics languages (SAS/R/SPSS) for processing the Matlab output Each language fits its niche well and we already have a fair amount of code in each. Right now, there's a lot of manual work to run all these steps that would be much better scripted. I've already done this on Linux, and it works relatively well. On Linux: matlab -nosplash -nodesktop -r "command" or echo "command" | matlab -nosplash -nodesktop ...opens Matlab in a "command line" mode. (That is, no windows are created -- it just reads from STDIN, executes, and outputs to STDOUT/STDERR.) My problem is that on Windows (XP and 7), this same code opens up a window and doesn't read from / write to the command line. It just stares me blankly in the face, totally ignoring STDIN and STDOUT. How can I script running Matlab commands on Windows? I basically want something that will do: ruby database_query.rb perl legacy_code.pl ruby other_stuff.rb matlab processing_step_1.m matlab processing_step_2.m # etc, etc. I've found out that Matlab has an -automation flag on Windows to start an "automation server". That sounds like overkill for my purposes, and I'd like something that works on both platforms. What options do I have for automating Matlab in this workflow?

    Read the article

  • jQuery - Drag of elements in areas - then not draggable any more

    - by Tim
    Hello! I have three div areas. Creating an element, which is draggable() with jQuery UI, I can drag it all over the screen. Dropping it in a special area, then I can not drag it any more. I created a full working demo: http://jsbin.com/enusu4/2/ There you can create a draggable element which is placed into the left green area. Dragging it to the middle or right green area, I can not drag the element. I increment the zIndex of the elements, but it does not work. Does anyone can help me, what's wrong? Best Regards.

    Read the article

< Previous Page | 106 107 108 109 110 111 112 113 114 115 116 117  | Next Page >