An automated series of instructions carried out in a specific order, such as a Windows script created to launch a specific program on startup.

learn more… | top users | synonyms (1)

4
votes
3answers
5k views

Diff in bash script?

I've been toying around with makefiles and bash scripts and I'm interested in this: Is it possible to get a boolean value from a diff(or something similar) so that I can use it in a bash script to ...
4
votes
3answers
8k views

How can you automatically run a script after connecting to a VPN on OS X?

I have configured the VPN connection in OS X 10.7.3, but since the network I'm connecting to uses a corporate proxy, has custom Maven repository servers, and other network-specific settings (remote ...
4
votes
3answers
1k views

bash shell script which adds output of commands

Let's say I have a command called foo which prints a number to the screen when called: $ foo 3 Let's also say I have another command called bar which prints another number to the screen when called:...
4
votes
3answers
34k views

copy file from windows to Linux

I am writing one script. it will run one linux machine. its targets includes linux, solaris and windows. I know that i can use scp to copy files between *nix. but how about copying file from windows? ...
4
votes
4answers
2k views

How to clear balloon popup from bash

I am setting a notification with notify-send in a script. The only problem is that when the script is called several times, all the notifications are added to a notification stack and only called one ...
4
votes
3answers
2k views

How can I logoff and go to stand-by via Win XP script?

I am looking for a way to write a script (of any sort) that would both log me off my local Windows account and also immediatedly put the computer to sleep / stand-by. I've found solutions that can do ...
4
votes
3answers
800 views

Breaking a file down of strings, into separate files each based on the first letter. BASH

Alright, so I have a file full of thousands of strings. Each one on it's own line. I want to make a script that will allow me to take this file, call it list.txt, and take the items from each line, ...
4
votes
2answers
5k views

OSX 'open with' bash script

I've got a bash script, potentially many of them in fact, which I'd like to be able to open files in OSX's finder with. It's a really, really simple concept but for some reason bash scripts are ...
4
votes
3answers
8k views

Windows xp command to search for files

What is the easiest way to search for files from a command line on Windows XP? I want to look for files created since a certain date, bigger than a certain size, or on a certain drive. Ideally I ...
4
votes
2answers
15k views

How to create multiple folders and name them by reading lines from text file?

I have a plain text file named Export.txt. It contains a list of geographical places, preceeded by a 3 digit number with leading zeros. Example --START OF FILE-- 001 Aberdeen 002 Bellevue 003 Camas ...
4
votes
4answers
12k views

How to append a string to a file name in Bash Shell?

So I am supposed to find all the files in the given directory with surffix of .C or cc, and change their name to .C.blah or .cc.blah Is there a command to do that? Or should I implement this with ...
4
votes
4answers
14k views

How can I launch multiple screen sessions from a single bash script?

I've written a script (that doesn't work) that looks something like this: #!/bin/sh screen -dmS "somename" somecommand for i in {0..5}; do screen -dmS "name$i" anothercommand $i done For some ...
4
votes
3answers
313 views

How to pass a file that changes name to another command in Bash?

I frequently use wget to download tarballs and zip files from the web, then either untar then or gunzip them. I do: wget google.com/somefile.zip unzip somefile.zip rm somefile.zip Is there a way ...
4
votes
1answer
5k views

Setting file creation date in Mac OS X

I need a script to set the creation date to the modification date for a bunch of files created by my sound recorder - any way to do this? Running Mac OS X 10.4.11
4
votes
5answers
2k views

Does anyone know of a scriptable way to switch Internet Proxy LAN Settings for browsers

I have two networks at work and when I have to use my Wireless settings I need IE to use one set of Proxy LAN Settings, and when I am plugged in I need a different set. I have been looking for a ...
4
votes
3answers
1k views

Script to get images in folder with dimensions printed to a .txt file

As title goes, is there a script for Win 7 to get printed on a .txt file all the images (JPG, PNG, GIF ecc) inside a folder along with "filename" and "pixels dimension"? I've tried with dir on ...
4
votes
1answer
2k views

What scripting/programming languages are default on Mac OSX?

I was wondering what programming or scripting languages come pre-installed on OSX? Particularly programs that can be run from the command line. I'm planning on parsing some CSS, and outputting an ...
4
votes
3answers
2k views

script to run sox to combine multiple mono tracks to stereo

I have a folder full of .wav audio files. Some are stereo, most are mono splits. The mono split pairs are all named foo bar track.L.wav and foo bar track.R.wav I can use the command line tool sox ...
4
votes
2answers
2k views

Script or tool to get the IP address of a remote host

I want to set an environment variable with the IP address of a given remote host. This is the solution I've arrived to: export IP=`curl http://network-tools.com/default.asp?host=www.example.com | ...
4
votes
4answers
2k views

How to automatically launch a shell script when content of a given directory is changed

I'm developing a web project using some libraries that force me to launch a shell command to compile some files everytime i modify them. This task is obviously tiresome and i'm looking to find some ...
4
votes
3answers
6k views

Programmatically check if a Windows Server 2008 Feature is installed, and Install it

I'd like to be able to detect in a script whether a Windows Server 2008 installation has specific Windows features enabled, and install them if necessary. I do not simply want to use a "try to ...
4
votes
2answers
5k views

Run script on Windows every n minutes

What's the best way on a Windows machine to run some sort of script every n minutes? I've googled around and read that Windows Scheduler is best avoided.
4
votes
2answers
3k views

Sending mail from the command line, in an automated way

I want to be able to send a text file through an SMTP server of my ISP (port 25) to an email address on the internet, like my Office email address, or my GMail address. I have a basic Ubuntu 9.04 ...
4
votes
2answers
57 views

for loop…in a for loop…in a for loop?

So I have a bunch of locations I need to check for two possible filenames, however the directory names vary. So here's essentially what I'm trying to optimize: for /r "%ProgramFiles%\WildGames" %%i ...
4
votes
1answer
281 views

Check if there are any empty files in a folder

I have a script that downloads 17 files from a FTP server every time, but sometimes some files weigh "0" for some reasons. So I'm searching for a bash script that checks if there are any files whose ...
4
votes
1answer
240 views

Using a shell script but it fails with spaces on directory or name

I'm relatively new to Linux script and I'm having an issue with one I'm trying to use when there are spaces in the directory name or file name. The script shrinks PDF files so that i can put them in ...
4
votes
1answer
5k views

Append to start of filename

I'm trying to add the word [Replay] to all mp3 files in a folder using a batch file like so: @echo off for %a in (c:\folder\*.mp3) do ren %a [Replay]%a But it wont rename the files. all the ...
4
votes
3answers
187 views

Download a pdf from a website every 24 hours?

I recently found G24, a pdf that The Guardian updates regularly with news summaries, which I can then print out. Is there a method to download said pdf every 24 hours? It has a static link, as they ...
4
votes
4answers
254 views

How to cut a file into pieces more efficiently?

Suppose I have a 10MB text file foo.txt, and it has 100,000 lines. Now, I want to process foo.txt window by window, with a window size 10. My current script is like this: for ((i=0;i<$lines;i=i+$...
4
votes
2answers
3k views

What software can I use to scrape (download) a MediaWiki wiki? [closed]

I want to scrape an entire wiki that uses MediaWiki software. The amount of pages are pretty small, but they have plenty of revisions, and I'd like to preferably scrape revisions as well. The wiki ...
4
votes
2answers
907 views

Command line too long in batch file for Gimp

I have run into an issue using GIMP's batch processing. I have a lot of files spred over a directory tree which need to be processed by a script-fu. I tried to generate a batch file which calls my ...
4
votes
5answers
4k views

Zipping all files/dirs in a directory except hidden ones?

How can I make a zip of all the files and subdirectories in the directory mydir, except all those files/dirs that begin with a .*? The command: zip -r mydir.zip mydir/ ...will include everything. ...
4
votes
3answers
5k views

Firefox plugin to block scripts of only specified websites

I'm looking for a Firefox plugin that blocks JavaScript from specified URLs. Example: I add: "google-analytics.com" It then blocks all scripts coming from Google Analytics. Essentially a ...
4
votes
2answers
634 views

How to properly restore settings when running a script using “source”?

I'm writing a script that needs to be executed using source, because its task is to modify the environment. During the script, I want to use set -e so that any error stops the script. The script looks ...
4
votes
1answer
5k views

Can I automatically reboot if disconnected from the internet?

I have an old desktop that I'm running as a web server from my home while I'm at college. The internet at home is crappy and a lot of times when it goes down, the desktop can't reconnect without a ...
4
votes
2answers
3k views

Use sed command to replace , appearing between numbers

I have a CSV file where data are in the following format |001|,|abc,def|,123456,789,|aaa|,|bbb|,444,555,666 I want to replace only those "," that appears between numbers with some other character ...
4
votes
1answer
545 views

how to copy I/O not just redirect (Windows and Linux)

I have a simple call command call calabash -D sim.xpl >test.txt 2>&1 and this redirects into test.txt, how do I do both redirect into a file and allow it to show up in the prompt? (I ...
4
votes
1answer
992 views

gnu screen automation

i'd like to launch GNU screen, some shell command in it, then open new screen window(s) with different command(s) - all that automatically, from a script. is it possible? UPDATE the screen windows ...
4
votes
3answers
783 views

Windows Startup and Shutdown scripts

In the group-policy editor, I see an option to add scripts to be executed on Startup and another option for scripts to be executed on Shutdown. Are these intended for personal use? And if so, are ...
4
votes
1answer
68 views

Can I create a “file” that, when opened, actually gives the output of a command?

I've found myself in a couple of situations now where I'd like to have such a "file" that essentially runs a script whenever it's "opened", allowing me to "read" it's output. For example, I might ...
4
votes
1answer
807 views

Simplest setup on Windows to send HTTP request, get and apply regex to response, and write match(es) to output file

I'd like to write a script that records the size of the close votes review queue on SO (currently ~95.5k), polling just a few times an hour, so I could plot a general trend. I know what I'm going to ...
4
votes
1answer
1k views

Split window programmatically with iTerm?

on my development workstation I often have to start the same commands every morning. zeus start, zeus server (booting rails via zeus), redis-server, and like 3 others. I know a lot of people would ...
4
votes
2answers
793 views

Bash autocomplete for different directories

I've played with bash autocomplete now for a while, but couldn't find a solution for my problem. I have a project directory with subfolders like this: projects/ruby/project1 projects/ruby/project2 ...
4
votes
3answers
1k views

Handling prompts from an installer in Linux command line

I am writing a bash script that, amongst other things, installs some software. One of the installers I run requires answering some questions. For example: Is the default install folder ok (yes/no)? ...
4
votes
5answers
789 views

Automatically wake up notebooks not on the ethernet

I am looking for an automated backup system and I like bacula. I have 3 Notebooks and a Desktop computer that need regular backup. Now I don't want to let them run all night just to do the backuping, ...
4
votes
2answers
3k views

init.d script not executing?

I have a script on ubuntu that I put in /etc/init.d. It has 0755 permissions, and I can run it manually both executing it and sourcing it, with good results. I have symlinks in both /etc/rc3.d and /...
4
votes
3answers
34 views

Default Homepage Overridden by Manufacturer Defaults

I've got a Lenovo Thinkpad that I'm trying to change the default homepage in IE in for all users. I've tried a number of things, but every time I create a new user the homepage is always the Lenovo ...
4
votes
1answer
106 views

Batch script to delete specific folders

I want to be able to run a script at a parent folder that contains other folders, the script will delete all the folders of a certain name. So for example to remove all the bin folders and only them: ...
4
votes
2answers
1k views

Counting pages within Word [.doc] documents

I'm trying to find a way of listing the number of pages within multiple word documents, all saved within the same folder. Is this possible using VBA? I am using: Windows 7 and Microsoft Office 2007
4
votes
2answers
1k views

Is there a way to add a dynamic signature to an email?

I'm trying to create an email signature that will display differently on a recipient's computer based on what state their IP address is in. I was wondering if there are any known ways of accomplishing ...