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
4answers
14k views

How do I make a script run upon startup of the Ubuntu machine?

I want to run /home/myuser/go.py How do I make that run in the background, everytime my linux machine boots up?
4
votes
3answers
768 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
64 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
426 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
3answers
754 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
1answer
7k views

Running msiexec with PowerShell

I'm try to run msiexec in PowerShell but I keep getting an error message. If I run it from cmd then it's all fine. Can someone please let me know how I can run this command in PowerShell? This is ...
4
votes
1answer
1k views

Batch video presenting (playing, pausing, going to specific time, …) in Linux

Is it possible to write an action file (e.g. a script) that plays some video files? I need it to be programmable to automatically perform these actions: start from a specific time play up to a ...
4
votes
5answers
726 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
668 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
1answer
1k views

Using launchd to kill and restart Finder in OS X

I'm trying to use a launchagent on login to kill the Finder, and then re-launch TotalFinder, to automatically apply the colorsidebar mod for OS X 10.7 (the mod can be found here). If I use the ...
4
votes
2answers
104 views

How to invoke actions from an executable in PowerShell?

I am using Powershell 2.0 on Windows 7 SP1, but any answers covering versions 1.0-4.0 would be nice. I know that this command opens Paint via PowerShell: & "C:\Windows\system32\mspaint.exe" ...
4
votes
3answers
1k views

Logout user script

I am trying to create a script in ARD that will let me logout a user. Now I have a script which does start the logout, but I want it to execute instead of waiting 60 seconds. The script currently ...
4
votes
1answer
113 views

Extract data from an online atlas

There is an online atlas that I would like to extract values from. The atlas provides a tool ('Query') to extract values when you click a location or enclose a region on the map, or you can specify ...
4
votes
1answer
429 views

Unlock PC with Windows Task Scheduler

I need to set up a Scheduled Task to unlock Windows 7 PC at specific time. And second Task, to lock at other specific time. Is this possible by cmd.exe command, or I need to use some third party ...
4
votes
1answer
963 views

How to call a cmd on a remote server without having the absolute path

I would like to call a cmd (let's call it x.cmd) on a remote server. The x.cmd will return a log file in a log folder. Problem is this log folder in x.cmd doesn't have an absolute path (just a ...
4
votes
1answer
3k views

Shell script - bad interpreter: Operation not permitted

I put the below script in a file called "volume", and put that file in a folder within $PATH. I can execute it fine by "bash thatpath/volume 10" but when I try to execute it using just "volume 10" ...
3
votes
5answers
940 views

How do I flip the line orders of a document with 500+ lines?

Line 1 Line 2 Line 3 Line 4 Line 5 should become Line 5 Line 4 Line 3 Line 2 Line 1 I need a notepad script to do this.
3
votes
6answers
493 views

Physical button to run scripts on a Windows machine

I frequently come in contact with people who absolutely cannot operate a PC, no matter how much training they get. I need some sort of programmable physical button or remote control that executes a ...
3
votes
5answers
10k views

Running scripts from another directory

Quite often, the script I want to execute is not located in my current working directory and I don't really want to leave it. Is it a good practice to run scripts (BASH, Perl etc.) from another ...
3
votes
3answers
3k 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 ...
3
votes
4answers
2k views

In linux how do I to get ' quote ` back-tic through the shell into sed.

In linux how do I to get the ascii decimal/hex/oct code from a char or a ascii char from a decimal/hex/oct code. I see from the gnu sed user manual that I can use the \d# \o# \x# to specify a ...
3
votes
3answers
931 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 ...
3
votes
4answers
11k views

Verify that a cron job has completed

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 ...
3
votes
3answers
454 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, ...
3
votes
2answers
4k 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 ...
3
votes
7answers
2k views

UNIX find dirs that contain a particular file (pom.xml) then execute command in that dir

I want to, from a root dir, find all dirs that contain a certain file name (pom.xml), then cd to that dir and execute a command. I can do this in a script but I was hoping to do this with a single ...
3
votes
3answers
17k 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? ...
3
votes
2answers
130 views

Very Simple Script to Remove Last 5 Lines of a Series of Text Files

For some reason this script outputs three files for each original, rather than one. Must have made some trivial error - I'm new to this! Much obliged if anyone could explain why this happens. ...
3
votes
2answers
1k views

Bash prefix string with tilde to expand to home directory

I can't figure out how to prefix a string (e.g. "user1") with a tilde (~) to produce ~user1 and have that expand to user1's home directory. Here is what I have now: USER="user1" ls ~${USER} ls: ...
3
votes
1answer
183 views

Can I Enter a Command on More than One Line in a Command Prompt Window or Script?

I have a long command line, and I would like to enter it on several lines. Something like the following (if it were possible): vsdbcmd /a:Deploy /manifest:Database.deploymanifest _ ...
3
votes
3answers
257 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 ...
3
votes
4answers
2k views

sudo displays typed password in bash script

I have a bash script that uses sudo a few times. There's a couple of strange points about it though. It asks me for my password a few seconds after I've already entered it for a previous command. ...
3
votes
4answers
392 views

On Linux or Windows, how do I find the path for all mp3s that are the only mp3 in that directory?

I have a Music folder and the contents look like this: Music     -ArtistA ...
3
votes
2answers
1k 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 | ...
3
votes
5answers
2k views

How to run a bash script outside of a terminal?

Hey All, wrote this script to confuse my girlfriend when she is using my computer. The only trouble is that if the terminal gets closed the script stops to execute. It currently executes in the ...
3
votes
2answers
3k views

Run A Script When Connected To A Wireless Network In Linux

Is it possible to have a script run when I connect to a wireless network? My university hijacks all HTTP(S) connections when you first connect to force you to log in with your university account. ...
3
votes
1answer
168 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 ...
3
votes
3answers
3k views

Run python script from Finder rather than edit?

Max OS X. When I double-click on a python script it opens in the default editor. How might I make it so that when I double-click, or choose the script from Applications, it executes from the python ...
3
votes
1answer
3k views

Replacing /bin/bash with /bin/false in /etc/passwd file

I am writing a program to disable users from a system, i want to replace /bin/bash to /bin/false. Example xxx:x:1:22:xx:/export/home/xx:**/bin/bash** replace to ...
3
votes
5answers
15k views

How to use crontab to run a script as nobody

This is on a CentOS machine. I'm trying to run a script as user nobody (or as a user with minimal permissions) at a certain time every day. Here is nobody: [root@CentOS % ~] grep "^nobody" ...
3
votes
2answers
605 views

Change the OSX system language in a script

Manually I just go into the system preferences, change the language ordering, and restart my app so it starts up in the default system language. Then I can run automated tests with the app running in ...
3
votes
4answers
8k 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 ...
3
votes
3answers
3k views

How can I take hundreds of smaller images and create one big tiled image?

I have 251 images that are 128x128 in size; I need to create one big image that includes them all tiled together. The image will be 32128x32128 in size if all goes well (Paint.NET says it will be ...
3
votes
1answer
310 views

Force a bash script to run to completion where some items may stick

I've a Uni assignment I'm building that I need to run multiple times with multiple different parameters to check run times. At the moment I've a simple bash script that looks a little like the below - ...
3
votes
3answers
3k 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 ...
3
votes
1answer
3k views

In TextWrangler for Mac OS X, how to change the selected text to lowercase using a keyboard shortcut?

I know how to use the menu to change case, but I want it to be a keyboard shortcut. Other text editor have this feature but I would prefer to stick with TextWrangler. Does one already exist or is ...
3
votes
1answer
2k 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 ...
3
votes
2answers
656 views

Why is my bash script not receiving the exit code from umount?

This is my first time attempting to write a long bash script to manage a server I run, and when using "set -ex" the script exits when umount fails. I thought my if statement would catch it but the ...
3
votes
1answer
3k views

I want to create an AutoHotKey script that waits for a window and sends some keystrokes to it, but the keystrokes are repeating by default

I want an AutoHotKey script that waits for a particular window and then sends keystrokes to that window. However, since the waiting is done in a loop, the keys are sent again and again. Let's say I ...
3
votes
2answers
1k views

Clear the TEMP folder on shutdown

I am following some instructions in More Ways To Speed Up Windows XP to help speed up my computer. One of those was to delete the temp folder on shutdown. Yet after I shutdown and then boot up, the ...