Search Results

Search found 29612 results on 1185 pages for 'script console'.

Page 88/1185 | < Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >

  • Run shell command with variable in filename via Python

    - by rajitha
    I have files with naming convention st009_out.abc1.dat st009_out.abc2.dat st009_out.abc3.dat .................. .................. I am writing Python code where I want to use data from the file to perform a math function and need to extract the second column from the file. I have tried it this way: for k in range(1,10): file1=open('st009_out.abc'+str(k)+'.dat','r') ........... os.system("awk '{print $2}' st009_out.abc${k}.pmf > raj.dat") but this is not working as it is not taking the value of k in the shell command. How do I progress?

    Read the article

  • Verify that a cron job has completed

    - by skylarking
    Is there a command that can be run to verify that a users cron job has run successfully? Platform is Ubuntu 8.04 LTS. I have scripts in /home/useraccount/bin/ running crontab -l while logged in as user results in: # m h dom mon dow command @hourly /home/useraccount/bin/script_1 @hourly /home/locateruser/bin/script_2 I realize scripts could send email or write to a log with a timestamp, but wondering if there is just a way to verify it ran from the command line.

    Read the article

  • PowerShell script halts execution when Windows XP PC is locked

    - by jshin47
    I have the following script that does a continuous ping and reports failures. It works fine, except the loop apparently "suspends" when the computer is locked. I have confirmed this by starting the script, immediately locking the PC, waiting 10 minutes, and seeing how many pings have occurred. It is nowhere near the expected number. What could be the culprit? Write-Host "Entering monitoring loop..." -Background DarkRed $ping = new-object System.Net.NetworkInformation.Ping $count_up = 0 $count_dn = 0 $count_dd = 0 while ($true) { $result = $ping.send("10.1.1.1") if ($result.Status -eq "Success") { $count_up++ $count_dd = 0 } else { $count_dn++ $count_dd++ $this_date = Get-Date Write-Host "VPN ping failed at time " $this_date -Background Magenta if ($count_dd -gt 3) { Write-Host "***VPN is Down***" `a send_mail_notification("VPN is Down", "") } } if ($Host.UI.RawUI.KeyAvailable -and ("q" -eq $Host.UI.RawUI.ReadKey("IncludeKeyUp,NoEcho").Character)) { Write-Host "Exiting monitoring loop..." -Background DarkRed break; } Start-Sleep -m 250 } $total = $count_up + $count_dn $uptime = 100 * $count_up / $total Write-Host $count_up " out of " $total " pings for a " $uptime "% uptime."

    Read the article

  • linux shell utils: convert a list of hex to list of decimals

    - by osgx
    Hello How can I convert a file with a lot hex numbers into the decimal? Example: file1 0x59999 0x5acdc 0xffeff I want to start $ cat file1 | util | cat file2 and get file2 with smth like 1021489 1249230 3458080 (numbers in example output are random, as I cant convert so long hex to dec) Upd: perl : perl -pe '$_=hex;$_.="\n"'. Can anybody do it better? The real task is a sorting of hex numbers.

    Read the article

  • How can I delete rest of the line after a specific string?

    - by nixdagibts
    I'm looking for a way to search for a specific string e.g. '=UUID:' and delete it and all following characters per line. I would prefer a way/macro/addon for notepad++. But all other tools or scripts are welcome :) Before *://81.88.22.6/*=UUID:63969B2469B7A94EBBDBD7CB5B9C00BA *://*-ad.cgi*=UUID:3C8EFF48B674CC42BF5B6E2B7BA820E7 *://*-ads/*=UUID:0D6CF7D5BE3F034C8A136CC99A074406 Note that the numbers are always different per line so you couldn't do a search 'n replace with them. Should look like this after *://81.88.22.6/* *://*-ad.cgi* *://*-ads/*

    Read the article

  • Using SSH, transfer webURL to remote machine

    - by AlanTuring
    Hi so i was doing some research in the library so i could use some pictures later on my Desktop computer in my room. I have space on my Lab account which i usually SSH into, and i was wondering if URL's can be directly transferred over to a remote machine and saved on the hard disk. I was thinking something like this: scp http://click.si.edu/images/truncatedurl.jpg /home3/etc.../filename.jpg is this possible? Thanks in advance.

    Read the article

  • forfiles.exe scripting

    - by PHLiGHT
    I'm looking to automatically delete files older than 7 days old with forfiles. The code below works when I manually do it it and respond yes to deleting the files. How can I incorporate the yes into this? This is the output E:\Documents and Settings\Administratorforfiles -p "H:\SHARED\Sca ns" -s -m . -d -7 -c "cmd /c del @path" Could Not Find H:\SHARED\Scans.DS_Store H:\SHARED\Scans\XXX\DOC006.XSM*, Are you sure (Y/N)?

    Read the article

  • Playback random section from multiple videos changing every 5 minutes

    - by brian
    I'm setting up the A/V for a holiday party this weekend and have an idea that I'm not sure how to implement. I have a bunch of Christmas movies (Christmas Vacation, A Christmas Story, It's a Wonderful Life, etc.) that I'd like to have running continuously at the party. The setup is a MacBook connected to a projector. I want this to be a background ambiance thing so it's going to be running silently. Since all of the movies are in the +1 hour range, instead of just playing them all through from beginning to end, I'd like to show small samples randomly and continuously. Ideally the way it would work is that every five minutes it would choose a random 5-minute sample from a random movie in the playlist/directory and display it. Once that clip is over, it should choose another clip and do some sort of fade/wipe to the chosen clip. I'm not sure where to start on this, beginning with what player I should use. Can VLC do something like this? MPlayer? If there's a player with an extensive scripting language (support for rand(), video length discovery, random video access). If so, I will probably be able to RTFM and get it working; it's just that I don't have time to backtrack from dead-ends so I'd like to start off on the right track. Any suggestions?

    Read the article

  • How to print new line character with echo?

    - by Summer_More_More_Tea
    I dump a string with hexdump like this 2031 3334 2e30 0a32 2032 3331 302e 000a. It is clear that 0x0a is new line character, however, when I try to echo this string out, I always got 1 430.2 2 13.0 -- the new line is replaced with a space, even I use the -e flag. What may be the problem? Does the tailing \0 ruin the output? Is there any alternatives to print 0x0a a new line? Thanks and Best regards.

    Read the article

  • rss downloader script

    - by The Digital Ninja
    I have a Synology NAS that is powered by linux at my house. I'm looking to set up a cron script to check a group of rss feeds and auto download new video podcasts to a shared folder. I can do most of the scripting, such as deleting files older than 3 weeks and the wget parts. But I'm not sure how to parse the rss feed and check dates to only grab the latest. I figured its best not to re-invent the wheel and surly someone out there has a command line rss downloader or some such script. Any ideas?

    Read the article

  • [Notepad++] delete rest of line after specific string

    - by nixdagibts
    I'm looking for a way to search for a specific string e.g. '=UUID:' and delete it and all following characters per line. I would prefer a way/macro/addon for notepad++. But all other tools or scripts are welcome :) Before ://81.88.22.6/=UUID:63969B2469B7A94EBBDBD7CB5B9C00BA ://-ad.cgi*=UUID:3C8EFF48B674CC42BF5B6E2B7BA820E7 ://-ads/*=UUID:0D6CF7D5BE3F034C8A136CC99A074406 Note that the numbers are always different per line so you couldn't do a search 'n replace with them. Should look like this after ://81.88.22.6/ ://-ad.cgi* ://-ads/*

    Read the article

  • Is there a chroot build script somewhere?

    - by Nils
    I am about to develop a little script to gather information for a chroot-jail. In my case this looks (at the first glance) pretty simple: The application has a clean rpm-install and did install almost all files into a sub-directory of /opt. My idea is: Do a find of all binaries Check their library-dependencies Record the results into a list Do a rsync of that list into the chroot-target-directory before startup of the application Now I wonder - ist there any script around that already does such a job (perl/bash/python)? So far I found only specialized solutions for single applications (like sftp-chroot). Update I see three close-votes for the reason "off topic". This is a question that arose because I have to install that ancient piece of software on a server at work. So if you still feel this is off-topic - leave a comment...

    Read the article

  • How to execute a command whenever a file changes?

    - by Denilson Sá
    I want a quick and simple way to execute a command whenever a file changes. I want something very simple, something I will leave running on a terminal and close it whenever I'm finished working with that file. Currently, I'm using this: while read; do ./myfile.py ; done And then I need to go to that terminal and press Enter, whenever I save that file on my editor. What I want is something like this: while sleep_until_file_has_changed myfile.py ; do ./myfile.py ; done Or any other solution as easy as that. BTW: I'm using Vim, and I know I can add an autocommand to run something on BufWrite, but this is not the kind of solution I want now. Update: I want something simple, discardable if possible. What's more, I want something to run in a terminal because I want to see the program output (I want to see error messages). About the answers: Thanks for all your answers! All of them are very good, and each one takes a very different approach from the others. Since I need to accept only one, I'm accepting the one that I've actually used (it was simple, quick and easy-to-remember), even though I know it is not the most elegant.

    Read the article

  • How can I read out internal pdf creation/modified date with Windows PowerShell?

    - by Martin
    PDF files seem to have a separate set of file properties which contain (among others) a creation date and a modified date (see screenshot here: http://ventajamarketing.com/writingblog/wp-content/uploads/2012/02/Acrobat-Document-Properties1-300x297.png). Those date obviously can differ from the creation and modified date shown in the file system (Windows Explorer). How can I access the date information in the PDF file and read it out in Windows 7 with Windows PowerShell (or maybe another method)?

    Read the article

  • Creating a link to name changing directory

    - by groove1534
    I have an Ubuntu 12.04 installed using wubi + Win7. I'm trying to create a link to "my documents" directory which located in my C drive: C:\Users\Myuser\My Documents\ Since the Ubuntu is installed in D:\, which is the "host", my C drive is accessible via /media/some_changing_hex. This hex get changed each time I restart my machine. So I need, somehow, to create a link that uses regex OR a link that somehow gets the the first (in this case - only) subdirectory in /media (something like all_subdirectories[0]). So how do I do that?

    Read the article

  • Kill program after it outputs a given line, from a shell script

    - by Paul
    Background: I am writing a test script for a piece of computational biology software. The software I am testing can take days or even weeks to run, so it has a recover functionality built in, in the case of system crashes or power failures. I am trying to figure out how to test the recovery system. Specifically, I can't figure out a way to "crash" the program in a controlled manner. I was thinking of somehow timing a SIGKILL instruction to run after some amount of time. This is probably not ideal, as the test case isn't guaranteed to run the same speed every time (it runs in a shared environment), so comparing the logs to desired output would be difficult. This software DOES print a line for each section of analysis it completes. Question: I was wondering if there was a good/elegant way (in a shell script) to capture output from a program and then kill the program when a given line/# of lines is output by the program?

    Read the article

  • Runas command for user without password

    - by user156558
    I want to use the runas command in CMD and from Batch files to gain elevated permissions, but I don't have an admin password on my PC because it's my home computer and I'm the only user. Every time I try to use the runas command it asks me for a password, then tells me that blank passwords are not permitted, is there any way round this? I know I can just right click and select run as administrator, but I would much rather have a command that can do it as that is not always an option, and it's just a bit of a pain. I could just be making some kind of basic mistake as I'm not hugely experienced with command prompt, but I'm not completely clueless.

    Read the article

  • How to auto-update a website mirror with exceptions to certain pages?

    - by tomatosalad
    I'm currently mirroring a website on my server. The site itself is rarely updated, but it is updated enough that info can become outdated quickly. I mirrored it first with wget, and this worked fine, but I made some changes: The original index.html used frames, but the site also provides a main.html which is essentially index.html but without frames. I deleted index.html and renamed main.html. I did not want to mirror the webchat, blog or forum, so I deleted those files and directories and made directories "blogs" "forum" and "chat" and placed a php redirect in each of those, redirecting visitors to the orignal site. I'd like to auto-update the mirror (maybe once every 24-72 hours), but preserve the changes I made. Is this possible? How would I go about doing it? I am completely clueless as to how. Thanks for any and all help! :)

    Read the article

  • Rearrange content of a file

    - by VikJES
    I'd like to rearrange the content of a file on a per line basis (see below), ideally without using Perl or Python (I'm not allowed to... Don't ask.) The input file contains unordered header lines and lines with backup operation results. The output files should contain the lines ordered as shown below. Original file: Completed Backups Backups with Warnings Failed Backups Server A backup was completed with warnings Server B backup was successful Server C backup failed Server D backup was completed with warnings End result: Completed Backups Server B backup was successful Backups with Warnings Server A backup was completed with warnings Server D backup was completed with warnings Failed Backups Server C backup failed

    Read the article

  • How can I delete everything after the first column in Notepad++?

    - by Bob J
    I'm trying to get rid of everything after a column in Notepad++. Column mode is not an option. Is it possible? What I have 70.97.110.40 159 ms [n/a] 21 70.97.117.177 134 ms [n/a] 21 70.97.120.10 75 ms [n/a] 21 70.97.122.105 87 ms www.portless.net 21 70.97.122.106 89 ms www.popovetsky.org 21 70.97.122.107 95 ms www.psmythe.net 21 70.97.122.104 98 ms wasabi.prostructure.com 21 70.97.122.108 89 ms crm.prostructure.com 21 70.97.122.109 87 ms internal.prostructure.com21 What I want 70.97.110.40 70.97.117.177 70.97.120.10 70.97.122.105 70.97.122.106 70.97.122.107 70.97.122.104 70.97.122.108 70.97.122.109 Thanks

    Read the article

  • Hi, I want to write a python script to do some things in excel [closed]

    - by MEOWER
    I want to write a python script that will open up this one excel file, "refresh" on the Bloomberg tab (with the Bloomberg add-in), and export all the individual sheets as csv? How can I do this? What are the basic things I should know and is there any reference script that I can use? I'm using Excel 2010 with the bloomberg plugin. Not sure if this is the correct forum to use but pls move this to another forum if it's more appropriate there. Thanks.

    Read the article

  • Running a script on startup before X starts in Ubuntu 9.10

    - by Epcylon
    I have a script that I want to run at startup to switch X-configs depending on location, but I can't seem to find out where to put it in order to get it to run before X is started. This results in me having to restart X to get it to run the correct config. Currently, my script is located in /etc/init.d/whereami, with symlinks in /etc/rc[2-5].d/S25whereami. I was trying to find out when X is started, in case the problem is simply the 25, but I can't seem to find the answer... Any help is appreciated.

    Read the article

  • Send emails in a non-interactive way in OS X

    - by flow
    I am using Mail.app in OS X 10.7. In a text file I have a list with 500 different email addresses, extracted from my address book, each one in a different line. I would like to send some christmas. So I prepared a text template and I would like to send same text in an email to each recipient, just to each one. So I wonder if using some scripting this could be done in a non-interactive way in OS X. In Linux I think this could be done using "mutt".

    Read the article

  • Cron is not available, what to use instead?

    - by alemani
    Hello, Several server accounts where I run some scripts to extract data from databases have very limited tools available and on some of them you are not allowed (even by formal request) to use cron, than been said, can you recommend any tool(s) I can use to schedule the execution of the scripts (just like cron does)? Thanks ins advance :)

    Read the article

< Previous Page | 84 85 86 87 88 89 90 91 92 93 94 95  | Next Page >