Search Results

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

Page 94/365 | < Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >

  • Replace delimited block of text in file with the contents of another file

    - by rmarimon
    I need to write a simple script to replace a block of text in a configuration file with the contents of another file. Let's assume with have the following simplified files: server.xml <?xml version='1.0' encoding='UTF-8'?> <Server port="8005" shutdown="SHUTDOWN"> <Service name="Catalina"> <Connector port="80" protocol="HTTP/1.1"/> <Engine name="Catalina" defaultHost="localhost"> <!-- BEGIN realm --> <sometags/> <sometags/> <!-- END realm --> <Host name="localhost" appBase="webapps"/> </Engine> </Service> </Server> realm.xml <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> I want to run a script and have realm.xml replace the contents between the <!-- BEGIN realm --> and <!-- END realm --> lines. If realm.xml changes then whenever the script is run again it will replace the lines again with the new contents of realm.xml. This is intended to be run in /etc/init.d/tomcat on startup of the service on multiple installations on which the realm is going to be different. I'm not so sure how can I do this simply with awk or sed.

    Read the article

  • PHP - Redirect and send data via POST

    - by Jeremy Rudd
    I have an online gateway which requires an HTML form to be submitted with hidden fields. I need to do this via a PHP script without any HTML forms (I have the data for the hidden fields in a DB) To do this sending data via GET: header('Location: http://www.provider.com/process.jsp?id=12345&name=John'); And to do this sending data via POST?

    Read the article

  • Check for messages apache Qpid

    - by c0mrade
    Is it possible to check for messages from Qpid queue from unix/windows console? Here is how I check via GUI : http://i47.tinypic.com/pbu5d.gif I can see all the info from Qpid JMX Management Console, is there a something close to this that I can use in console?

    Read the article

  • Script to download file and rename according to date on Windows Vista machine?

    - by Dave
    Hi, I need to daily run a script that will download a file from a fixed location and save it on my computer with an appropriate filename-YYYYMMDD-HHSS.ext timestamp. I need a historical record of what that file was at that particular time. I can manually check and see what the changes were, so compairson not needed. (I was looking for an online service that would do this for me, but I think a locally running script on my machine would be good enough). Although i do have php on my machine, i would prefer if its a pure windows builtin solution, just in case i have to (likely) adapt it to someone else's system (non-techies). If someone has something like this and can contribute the code - help would be most appreciated!! D

    Read the article

  • write to fifo/pipe from shell, with timeout

    - by Tim
    I have a pair of shell programs that talk over a named pipe. The reader creates the pipe when it starts, and removes it when it exits. Sometimes, the writer will attempt to write to the pipe between the time that the reader stops reading and the time that it removes the pipe. reader: while condition; do read data <$PIPE; do_stuff; done writer: echo $data >>$PIPE reader: rm $PIPE when this happens, the writer will hang forever trying to open the pipe for writing. Is there a clean way to give it a timeout, so that it won't stay hung until killed manually? I know I can do #!/bin/sh # timed_write <timeout> <file> <args> # like "echo <args> >> <file>" with a timeout TIMEOUT=$1 shift; FILENAME=$1 shift; PID=$$ (X=0; # don't do "sleep $TIMEOUT", the "kill %1" doesn't kill the sleep while [ "$X" -lt "$TIMEOUT" ]; do sleep 1; X=$(expr $X + 1); done; kill $PID) & echo "$@" >>$FILENAME kill %1 but this is kind of icky. Is there a shell builtin or command to do this more cleanly (without breaking out the C compiler)?

    Read the article

  • How do I wait for a service/process to start before continuing a batch script?

    - by Shane McD
    I am writing a windows batch script to uninstall some software. However I need to wait after the uninstaller has finished for a service to be restarted before continuing with the next uninstall. I can make the script wait for the uninstaller to finsh using:- for /f "usebackq" %%M in ('tasklist /nh /fi "imagename eq %process_1%"') do if not %%M==%ignore_result% goto 1 But I cannot for the life of me figure out how to get the script to then wait for a service to start before continuing the script and running more uninstalls. I am open to any suggestions.

    Read the article

  • Cruise control.NET invoking an IDE

    - by Maddy
    Hi, I have an IDE named VxWorks 653 2.2.3 Development shell which needed to be invoked all the time when i notice any change in my source files.So i had invoked this shell through a VB scripts which invokes two more .bat(Batch files) to get this shell popped up for execution.Now i feel that since my IDE can be invoked by command line,it can also be invoked through nant scripts using the statement like D:\WindRiver\wrenv.exe -p vxworks653-2.2.3 But what i see is that its not at all invoking.I had tried all different ways but all turned out to be in vain. Can anyone pls suggest me any way either in nant scripts or in cruise control by which my IDE can be invoked.Now at present i am using VB scripts which is a very long proceess. Thanks and regards Maddy

    Read the article

  • Trouble with piping through sed

    - by Joel
    I am having trouble piping through sed. Once I have piped output to sed, I cannot pipe the output of sed elsewhere. wget -r -nv http://127.0.0.1:3000/test.html Outputs: 2010-03-12 04:41:48 URL:http://127.0.0.1:3000/test.html [99/99] -> "127.0.0.1:3000/test.html" [1] 2010-03-12 04:41:48 URL:http://127.0.0.1:3000/robots.txt [83/83] -> "127.0.0.1:3000/robots.txt" [1] 2010-03-12 04:41:48 URL:http://127.0.0.1:3000/shop [22818/22818] -> "127.0.0.1:3000/shop.29" [1] I pipe the output through sed to get a clean list of URLs: wget -r -nv http://127.0.0.1:3000/test.html 2>&1 | grep --line-buffered -v ERROR | sed 's/^.*URL:\([^ ]*\).*/\1/g' Outputs: http://127.0.0.1:3000/test.html http://127.0.0.1:3000/robots.txt http://127.0.0.1:3000/shop I would like to then dump the output to file, so I do this: wget -r -nv http://127.0.0.1:3000/test.html 2>&1 | grep --line-buffered -v ERROR | sed 's/^.*URL:\([^ ]*\).*/\1/g' > /tmp/DUMP_FILE I interrupt the process after a few seconds and check the file, yet it is empty. Interesting, the following yields no output (same as above, but piping sed output through cat): wget -r -nv http://127.0.0.1:3000/test.html 2>&1 | grep --line-buffered -v ERROR | sed 's/^.*URL:\([^ ]*\).*/\1/g' | cat Why can I not pipe the output of sed to another program like cat?

    Read the article

  • Script to copy files on CD and not on hard disk to a new directory

    - by John22
    I need to copy files from a set of CDs that have a lot of duplicate content, with each other, and with what's already on my hard disk. The file names of identical files are not the same, and are in sub-directories of different names. I want to copy non-duplicate files from the CD into a new directory on the hard disk. I don't care about the sub-directories - I will sort it out later - I just want the unique files. I can't find software to do that - see my post at SuperUser http://superuser.com/questions/129944/software-to-copy-non-duplicate-files-from-cd-dvd Someone at SuperUser suggested I write a script using GNU's "find" and the Win32 version of some checksum tools. I glanced at that, and have not done anything like that before. I'm hoping something exists that I can modify. I found a good program to delete duplicates, Duplicate Cleaner (it compares checksums), but it won't help me here, as I'd have to copy all the CDs to disk, and each is probably about 80% duplicates, and I don't have room to do that - I'd have to cycle through a few at a time copying everything, then turning around and deleting 80% of it, working the hard drive a lot. Thanks for any help.

    Read the article

  • How to delay putting process in background until after it is ready to serve, in shell

    - by Jakub Narebski
    I have two processes: a server that should be run in background, but starts serving requests after a delay, and a client that should be started when server is ready. The server prints line containg "Acceptin connections" to its stderr when ready (server stderr is redirected to a file when running it in background). How to delay putting server process in background until server is ready to serve requests? Alternatively, how to delay running client until server is ready? Language: shell script (or optionally Perl).

    Read the article

  • Generate SQL server scripts from command line?

    - by Luke Sampson
    In Microsoft SQL Server Management Studio 2008 there is a "Generate scripts..." option under the Tasks menu. I'm just wondering if this tool is available from the command line somehow? It looks similar to the sqlpubwiz.exe command line tool that was available for SQL Server 2005, but I can't find this executable anywhere in the SQL 2008 installation.

    Read the article

  • Script telnet on webserver

    - by Kami
    Hi I would like to script telnet to test my website inputs handling. I can do it manually : telnet localhost 8888 ... GET / HTTP/1.1\n Host: localhost ...html response But I can pass command to telnet in my shell script ! I've tried : (echo "GET / HTTP/1.1\n"; echo "Host: localhost \n\n"; sleep 1) | telnet localhost 8888 It produces no results at all !

    Read the article

  • How to write stored procedures to separate files with mysqldump?

    - by Jader Dias
    The mysqldump option --tab=path writes the creation script of each table in a separate file. But I can't find the stored procedures, except in the screen dump. I need to have the stored procedures also in separate files. The current solution I am working on is to split the screen dump programatically. Is there a easier way? The code I am using so far is: mysqldump -p$PASSWORD --routines --skip-dump-date --no-create-info --no-data --skip-opt $DATABASE > $BACKUP_PATH/$DATABASE.sql mysqldump -p$PASSWORD --tab=$BACKUP_PATH --skip-dump-date --no-data --skip-opt $DATABASE

    Read the article

  • Did IE8 lose the document.frames collection?

    - by Nick
    Hey all.. I noticed that an application I am maintaining was giving me a javascript error in IE8 and FF. The script was trying to get a collection of frame elements: document.frames This always returned 'undefined'. I placed a watch on the document object and noticed that this collection does not seem to be a member of the document object in IE8. I think this was always the case in FF but this same code works in older versions of IE. Has this been removed? -Nick

    Read the article

  • Is there a bash shortcut for traversing similar directory structures?

    - by Steve Weet
    The Korn shell used to have a very useful option to cd for traversing similar directory structures e.g. given the following directorys /home/sweet/dev/projects/trunk/projecta/app/models /home/andy/dev/projects/trunk/projecta/app/models Then if you were in the /home/sweet.... directory then you could change to the equivalent directory in andy's structure by typing cd sweet andy So if ksh saw 2 arguments then it would scan the current directory path for the first value, replace it with the second and cd there. Is anyone aware of similar functionality in bash. EDIT 1 Following on from Michal's excellent answer I have now created the following bash function called scd (For Sideways cd) function scd { cd "${PWD/$1/$2}" } EDIT 2 Thanks to @digitalross I can now reproduce the ksh functionality exactly with the code from below (With the addition of a pwd to tell you where you have changed to) cd () { if [ "x$2" != x ]; then builtin cd ${PWD/$1/$2} pwd else builtin cd "$@" fi }

    Read the article

  • Concatenate a variable with a string

    - by user311130
    Hello all, I wrote a small bat file: @echo off rem runs the {arg[0].exe} - using its fully qualified name %~f1 IF %errorlevel% NEQ 0 (set boolResult=False) ELSE (set boolResult=True) rem case1 EVENTCREATE /T ERROR /ID 700 /L "MyTest Application" /D "exitcode: %errorlevel%; session id is %SessionName%" rem case3 EVENTCREATE /T ERROR /ID 700 /L APPLICATION /D "exitcode: %boolResult%; session id is %SessionName%" rem case4 EVENTCREATE /T ERROR /ID 700 /L APPLICATION /D "exitcode: %errorlevel%; session id is %SessionName%" And I have got some questions, if you could help me out... case1: I get the following error: ERROR: 'MyTest Application' log does not exist. Cannot create the event. *The only way to initial eventlog in through high-leve (c#) code? case3: How can I concatenate a string with some bat variable ? case4: How do I add a newline in the description? "exitcode: %boolResult%\n session id is %SessionName%" didn't do that. Thanks for any assistance

    Read the article

  • My perl script is acting funny...

    - by TheGNUGuy
    I am trying to make a jabber bot from scratch and my script is acting funny. I was originally developing the bot on a remote CentOS box, but I have switched to a local Win7 machine. Right now I'm using ActiveState Perl and I'm using Eclipse with the perl plugin to run a debug the script. The funny behavior I'm experiencing occurs when I run or debug the script. If I run the script using the debugger it works fine, meaning I can send messages to the bot and it can send messages to me. However when I just execute the script normally the bot sends the successful connection message then it disconnects from my jabber server and the script ends. I'm a novice when it comes to perl and I can't figure out what I'm doing wrong. My guess is it has something to do with the subroutines and sending the presence of the bot. (I know for sure that it has something to do with sending the bot's presence because if the presence code is removed, the script behaves as expected except the bot doesn't appear to be online.) If anyone can help me with this that would be great. I originally had everything in 1 file but separated them into several trying to figure out my problem here are the pastebin links to my source code. jabberBot.pl: http://pastebin.com/cVifv0mm chatRoutine.pm: http://pastebin.com/JXmMT7av trimSpaces.pm: http://pastebin.com/SkeuWtu1 Thanks again for any help!

    Read the article

  • process killed -- delete output file?

    - by user151841
    I have a bash script that runs on our shared web host. It does a dump of our mysql database and zips up the output file. Sometimes the mysqldump process gets killed, which leaves an incomplete sql file that still gets zipped. How do I get my script to 'notice' the killing and then delete the output file if the killing occurred?

    Read the article

  • Generating MySQL UPDATE statements containing BLOB image data

    - by Bob
    I'm trying to write an SQL statement that will generate an SQL script that will update a BLOB field with an IMAGE being selected from the database. This is what I have: select concat( 'UPDATE `IMAGE` SET THUMBNAIL = ', QUOTE( THUMBNAIL ), ' WHERE ID = ', ID, ';' ) as UPDATE_STATEMENT from IMAGE; In the above, THUMBNAIL is a BLOB field containing raw image data. When I run the resulting script I get the following error: ERROR at line 2: Unknown command '\\'. I first tried this without the QUOTE() function, like so: select concat( 'UPDATE `IMAGE` SET THUMBNAIL = \'', THUMBNAIL, '\' WHERE ID = ', ID, ';' ) as UPDATE_STATEMENT from IMAGE; Running the resulting script produces this error: ERROR at line 2: Unknown command '\0'. What is the proper function to apply to this BLOB field in the select, so the UPDATE statements will work? If context is required, I'm looking to migrate thumbnails generated on one server to another server for certain image IDs only. I would use mysqldump, but I don't want to clobber the entire table. Any help is greatly appreciated!

    Read the article

  • crone tab shell script do not save output

    - by Anas
    i use cron tab with command wget http://www.mydomain.com/page.php to run one of my pages in server. It works, but problem is output is sved with names page.php, page.php1, page.php2, page.php3 etc. Can i run the page using wget without sving output

    Read the article

  • Unwanted Shell expansion when assigning the output of a shell command to a variable

    - by Rob Goodwin
    I am exporting a portion of a local prototypte svn repository to import into a different repo. We have a number of svn properties set throughout the repo so I figured I would write a script to list the file elements and their corresponding properties. How hard can that be right. So I write started writing a bash script that would assign the output of the svn proplist -v to a variable so I could check if the specified file had any properties. #!/bin/bash svn proplist -v $1 o=$(svn proplist -v "$1") echo $o now this works fine and echos the output of the svn proplist command. But if the proplist command returns something like svn:ignore : * build it performs a shell expansion on the * and inserts the entire directory listing prior to the build property value. So if the directory had a.txt, b.txt and build files/dirs in it, the output would look like. svn:ignore a.txt b.txt build I figure I need to somehow escape the output or something to keep the expansion from happening, but have yet to find something that works. There are other ways to do this, but I hate when I cannot figure something out. and I have to admin, I think this one beat me ( well given the time I can spend on it )

    Read the article

< Previous Page | 90 91 92 93 94 95 96 97 98 99 100 101  | Next Page >