Search Results

Search found 7380 results on 296 pages for 'scripting languages'.

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

  • Output only characters between [ABC] and [/ABC]

    - by user564530
    $ cat somefile.txt afsdfv asdf[ABC]dafga asdfasf yxcvyxv[/ABC] asdadf yv[ABC]sdfb sdfgadfg [/ABC]adf asdf $ cat somefile.txt | NEEDEDONELINER > output.txt dafga asdfasf yxcvyxv sdfb sdfgadfg $ So the "NEEDEDONELINER" only outputs the characters between a [ABC] and [/ABC]. [ABC] could occur several times, and there could be random characters around it. I only need the random chars between the [ABC] and [/ABC]. I don't have time to learn Perl :\ Thank you in anticipiation!

    Read the article

  • Send mail from a Windows script

    - by Jörgen Lundberg
    I would like to send mail from a script on a Windows Server 2003 Standard Edition. I think the server setup is pretty much out of the box. The mail server is an Exchange one, and when you're on the internal network you can use plain old SMTP. I have done it from my machine with Perl, but unfortunately Perl is not available on the server. Is there an easy way of doing this from a .bat-file or any other way that doesn't require installing some additional software? Edit: Thanks for the quick replies. The "blat" thingie would probably work fine but with wscript I don't have to use a separate binary. I didn't see PhiLho's post the first time I edited and selected an answer. No need for me to duplicate the code here. Just save the script to a file, say sendmail.vbs, and then call it from the command prompt like so: wscript sendmail.vbs

    Read the article

  • shutdown.exe timer

    - by user311130
    hey, tryingto run shutdown.exe -l -t 10 only showed shutdown help manual. I thought of unekegant but working solution of ping -n 10 localhost shutdown.exe -l How wasty is is that solution? I thought of downloading sleep.exe, but I want my bat file to work on machine with no previuse preperations. any more ideas? Thanks

    Read the article

  • Regarding Shell variable

    - by arav
    I need to call another shell script testarg.sh within my main script. This script testarg.sh has arguments ARG1 ,ARG2, ARG3. I need to call up the below way ./testarg.sh -ARG1 -ARG2 -ARG3 ARG1 and ARG3 argument Variables are mandatory ones. If its not passed to the main script then i quit. ARG2 is an optional one. If the ARG2 variable is not set with value or it's not defined then i need not pass it from main script.So i need to call up the below way ./testarg.sh -ARG1 -ARG3 If the value exist for the ARG2 Varibale then i need to call the below way ./testarg.sh -ARG1 -ARG2 -ARG3 Do i need to have a if else statement for checking the ARG2 variable is empty or null. Is there any other way to do it.

    Read the article

  • build.xml in ant

    - by Codenotguru
    > Can anybody help me know what these tags do in build.xml file? > > 1)<property file="" location="."/> > 2)<property environment=""/> > 3)<property name="" value=""/> 4)<path > id="classpath.base"> 5)<pathelement > location="$some.jar"/> 6)<path > id="classpath.build"> 7)<path > id="classpath.test"> > 8)<target></target> > > Thank You

    Read the article

  • compare time using date command

    - by Andrei
    Say I want a certain block of bash script execute only if it is between 8 am (8:00) and 5 pm (17:00), and do nothing otherwise. The script is running continuously So far I am using date command. How to use it compare it current time within the range? Thanks

    Read the article

  • Receiving Text From Another Application

    - by Garry
    Hi, I'm building some home automation software with Cocoa/Objective-C. The main application will have a minimal GUI and will most likely be represented by a status bar icon only. I'm using proprietary speech-to-text software (MacSpeech Dictate) that takes my voice command and converts it to plain text. I then need to send this plain text to my app for parsing. Is there a way to send a string to a Cocoa application? Could AppleScript achieve this? How would I make the NSString string in my app "available" to receive the passed string? For reasons that are beyond the scope of this question - it is not possible to dictate the command directly into my app. Many thanks in advance,

    Read the article

  • Use matching value of a RegExp to name the output file.

    - by fx42
    I have this file "file.txt" which I want to split into many smaller ones. Each line of the file has an id field which looks like "id:1" for a line belonging to id 1. For each id in the file, I like to create a file named idid.txt and put all lines that belong to this id in that file. My brute force bash script solution reads as follows. count=1 while [ $count -lt 19945 ] do cat file.txt | grep "id:$count " >> ./sets/id$count.txt count='expr $count + 1' done Now this is very inefficient as I have do read through the file about 20.000 times. Is there a way to do the same operation with only one pass through the file? - What I'm probably asking for is a way to use the value that matches for a regular expression to name the associated output file.

    Read the article

  • GUNZIP / Extract file "portion by portion"

    - by Dave
    Hi. I'm on a shared server with restricted disk space and i've got a gz file that super expands into a HUGE file, more than what i've got. How can I extract it "portion" by "portion (lets say 10 MB at a time), and process each portion, without extracting the whole thing even temporarily! No, this is just ONE super huge compressed file, not a set of files please...

    Read the article

  • How can I quickly sum all numbers in a file?

    - by Mark Roberts
    I have a file which contains several thousand numbers, each on it's own line: 34 42 11 6 2 99 ... I'm looking to write a script which will print the sum of all numbers in the file. I've got a solution, but it's not very efficient. (It takes several minutes to run.) I'm looking for a more efficient solution. Any suggestions?

    Read the article

  • Parallel processing from a command queue on Linux (bash, python, ruby... whatever)

    - by mlambie
    I have a list/queue of 200 commands that I need to run in a shell on a Linux server. I only want to have a maximum of 10 processes running (from the queue) at once. Some processes will take a few seconds to complete, other processes will take much longer. When a process finishes I want the next command to be "popped" from the queue and executed. Does anyone have code to solve this problem? Further elaboration: There's 200 pieces of work that need to be done, in a queue of some sort. I want to have at most 10 pieces of work going on at once. When a thread finishes a piece of work it should ask the queue for the next piece of work. If there's no more work in the queue, the thread should die. When all the threads have died it means all the work has been done. The actual problem I'm trying to solve is using imapsync to synchronize 200 mailboxes from an old mail server to a new mail server. Some users have large mailboxes and take a long time tto sync, others have very small mailboxes and sync quickly.

    Read the article

  • Create folder for todays date on click of shortcut

    - by Ram
    Hi, I have a folder named as 2010. In this I want a folder for each month like "Jan10", "Feb10"....."Dec10" In each month folder I want to create folder for "Todays date" I have create a shortcut for that 2010 folder with Target as C:\WINDOWS\explorer.exe /n, /e, /select, F:\2010 I want a functionality that will execute when I click the shortcut for f:\2010 icon. Any pointer would be great help.

    Read the article

  • How to store and echo multiple lines elegantly in bash?

    - by EmpireJones
    I'm trying to capture a block of text into a variable, with newlines maintained, then echo it. However, the newlines don't seemed to be maintained when I am either capturing the text or displaying it. Any ideas regarding how I can accomplish this? Example: #!/bin/bash read -d '' my_var <<"BLOCK" this is a test BLOCK echo $my_var Output: this is a test Desired output: this is a test

    Read the article

  • Removing final bash script argument

    - by ctuffli
    I'm trying to write a script that searches a directory for files and greps for a pattern. Something similar to the below except the find expression is much more complicated (excludes particular directories and files). #!/bin/bash if [ -d "${!#}" ] then path=${!#} else path="." fi find $path -print0 | xargs -0 grep "$@" Obviously, the above doesn't work because "$@" still contains the path. I've tried variants of building up an argument list by iterating over all the arguments to exclude path such as args=${@%$path} find $path -print0 | xargs -0 grep "$path" or whitespace="[[:space:]]" args="" for i in "${@%$path}" do # handle the NULL case if [ ! "$i" ] then continue # quote any arguments containing white-space elif [[ $i =~ $whitespace ]] then args="$args \"$i\"" else args="$args $i" fi done find $path -print0 | xargs -0 grep --color "$args" but these fail with quoted input. For example, # ./find.sh -i "some quoted string" grep: quoted: No such file or directory grep: string: No such file or directory Note that if $@ doesn't contain the path, the first script does do what I want.

    Read the article

  • execute javascript function in a another iframe when parent is from different domain.

    - by Frushko
    The page A.com has 2 iframes B.com/page1 and B.com/page2. This is the code of A.com: <html><body> <iframe src="b.com/page1" name="iframe1" id="iframe1"> <iframe src="b.com/page2"> </body></html> I want to execute js function on B.com/page1 from B.com/page2. Both examples below works well when the parent is from the same domain but not in cross domain scenario: parent.window.frames['iframe1'].SomeFunction(args); or parent.document.getElementById('iframe1').contentWindow.SomeFunction(args); Is there any way to do it?

    Read the article

  • Good book for learning Bash shell?

    - by John Isaacks
    I want to learn how to write shell scripts. Particularly I want to write a svn post-commit script to upload files from a test server to a production server. I am sure I will want to write more as I get more into it. I have very little linux/unix knowledge. Can anyone recommend a good book?

    Read the article

  • On Solaris, what is the difference between cut and gcut?

    - by Chris J
    I recently came across this crazy script bug on one of my Solaris machines. I found that cut on Solaris skips lines from the files that it processes (or at least very large ones - 800 MB in my case). > cut -f 1 test.tsv | wc -l 457030 > gcut -f 1 test.tsv | wc -l 840571 > cut -f 1 test.tsv > temp_cut_1.txt > gcut -f 1 test.tsv > temp_gcut_1.txt > diff temp_cut_1.txt temp_gcut_1.txt | grep '[<]' | wc -l 0 My question is what the hell is going on with Solaris cut? My solution is updating my scripts to use gcut but... what the hell?

    Read the article

  • GET command is giving two kinds of ouput,why???

    - by developer
    iam using GET command to get the content of a page.When i write the same command on shell prompt it gives correct result but when i use that in PHP file then sometimes its giving correct result but sometimes it gives only half of the content i.e. end-half portion only. Iam using following command in shell script :- GET http://www.abc.com/ -H "Referer:http://www.abcd.com/" and following in PHP file :- $data=exec('GET http://www.abc.com/ -H "Referer:http://www.abcd.com/"'); echo $data; Now please tell why this command is not giving full content of the page when im using it in php file.

    Read the article

  • catching an event in VBScript

    - by be here now
    Hi, guys. This is a VBS script that opens google, fills a form, and clicks a search button. set ie = CreateObject("InternetExplorer.Application") ie.navigate("www.google.com") ie.visible = true while ie.readystate <> 4 wscript.sleep 100 WEnd set fields = ie.document.getelementsbyname("q") set buttons = ie.document.getelementsbyname("btnG") fields(0).value = "some query" buttons(0).click ie.quit Sub OnClickSub() MsgBox "button clicked!", 0 End Sub Obviously, buttons(0).click fires an onclick event of the button, which I somehow need to catch in my script, and provide it with some processing like launching OnClickSub(). Has anyone got any ideas how this should be done?

    Read the article

  • How to bundle shell script and C code?

    - by eSKay
    I have a C shell script that calls two C programs - one after the another with some file handling before, in-between and afterwards. Now, as such I have three different files - one C shell script and 2 .c files. I need to give this script to other users. The problem is that I have to distribute three files - which the users must keep in the same folder and then execute the script. Is there some better way to do this? [I know I can make one C code file out of those two... but I will still be left with a shell script and a C code. Actually, the two C codes do entirely different things... so I want them to be separate]

    Read the article

  • How to get the list of files in a directory in a shell script?

    - by jrharshath
    Hi, I'm trying to get the contents of a directory using shell script. My script is: for entry in `ls $search_dir`; do echo $entry done where $search_dir is a relative path. However, $search_dir contains many files with whitespaces in their names. In that case, this script does not run as expected. I know I could use for entry in *, but that would only work for my current directory. I know I can change to that directory, use for entry in * then change back, but my particular situation prevents me from doing that. I have two relative paths $search_dir and $work_dir, and I have to work on both simultaneously, reading them creating/deleting files in them etc. So what do I do now? PS: I use bash.

    Read the article

  • what does < < mean in the shell

    - by stib
    when looping recursively through folders with files containing spaces the shell script I use is of this form, copied from the internet: while IFS= read -r -d $'\0' file; do dosomethingwith "$file" # do something with each file done < <(find /bar -name *foo* -print0) I think I understand he IFS bit, but I don't understand what the < < characters mean. Obviously there's some sort of piping going on here.. It's very hard to google "< <", you see. TIA -stib

    Read the article

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