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)

3
votes
4answers
5k views

Under Ubuntu, how can I place a shell alias command that will be global to everyone?

Under Ubuntu 9.10, where can I place an alias command that will be valid to all users, root or otherwise, and that will work with a shell under GNOME as well as an ssh session and plain console login ...
3
votes
4answers
7k 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
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
7k 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 ...
3
votes
3answers
216 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
123 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
1answer
180 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
230 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
1answer
3k 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
3answers
2k views

How can I insert a line in the middle of a file, with awk, given a search pattern to insert AFTER or BEFORE

I want to insert some text in the middle of a file. The text to insert would be after a specific line, say, "<begin>". I don't know the line number, nor do I know the number of lines in the text ...
3
votes
2answers
635 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
2answers
12k views

Synchronize Internet Time in a Windows script?

Is there a way I can synchronize the system clock with an Internet Time server (i.e: time.nist.gov) via command-line? Preferably, this should be something executable via BAT or PowerShell script. ...
3
votes
1answer
884 views

newline in bash variable

My script contains something like this: ifc=$(ifconfig) With this, the ifc variable contains the output of the command ifconfig but without newlines. So, when I print it with echo $ifc I get only ...
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
4answers
382 views

How to automatically hide files put in a specific folder?

How should I go about automatically hiding files that I paste/drop in a folder, for example C:\test\ ? I thought about creating a batch file or using a program which runs continuously on the desktop ...
3
votes
1answer
126 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
9k 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 ...
3
votes
2answers
696 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 ...
3
votes
3answers
3k 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 ...
3
votes
2answers
301 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
2answers
8k views

init.d script not running on startup

I am hosting some Counter-Strike game servers on my dedicated server using screen. I have this script that I run when I want to start/stop the servers: #! /bin/sh # /etc/init.d/css-server # case ...
3
votes
2answers
4k views

Recorder for AutoIt

Does anyone know where to find the latest AutoIt recorder? The one here does not work. It does not find RWSettings.alg and I do not know what that is. Any help will be appreciated.
3
votes
4answers
5k 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
1k 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
2k 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
751 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
490 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
2k 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
3k 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 ...
3
votes
1answer
904 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 ...
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 ...
3
votes
1answer
11k views

Change NIC speed/duplex settings in script?

I have a laptop running Windows Server 2003 SP2, with PowerShell installed. Occasionally, this system has to be used in environments where it needs the NIC manually set to 100 Mbps/Full Duplex in ...
3
votes
3answers
12k views

How do you update an Excel file (Data Refresh and update formulas) WITHOUT opening the file?

I have an Excel file that want to update and save automatically with out having to open it or manually interact with. Manually, I open the file up and hit data refresh which goes and does a SQL query ...
3
votes
4answers
10k 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?
3
votes
1answer
2k views

Is there a way to make AutoHotKey select text?

I've seen a lot of info (here & elsewhere) about things you can get AutoHotKey to do with text once the user has selected it, but is there a way to have an AHK script select the text itself? I'm ...
3
votes
4answers
3k views

Mount a share on a Mac using a login hook

I have a script that mounts a Samba share to a folder on the desktop, it runs no problem but when its setup as a LoginHook it doesn't mount the folder. Does anyone have a working login hook that ...
3
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 ...
3
votes
1answer
447 views

SSH port forwarding with automatic reconnect, script executing at startup

In short, every time my computer boots, I would like to start a ssh port-forwarding connection that will reconnect with the server if the connection drops. Computer is Debian Wheezy x64. An initial ...
3
votes
3answers
696 views

How to check if zip file is empty in bash

How can I verify if the zip file is empty or not ? I cannot use if -s in bash as the zip file is not always zero in size. if the zip file has empty directories in it, I want to delete the file else ...
3
votes
1answer
1k views

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

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 ...
3
votes
2answers
531 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 ...
3
votes
1answer
4k 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 ...
3
votes
1answer
2k views

How can I batch/mass create users for a Filezilla FTP server?

I recently inherited two FTP servers; both systems run Filezilla Server. One has a small user-base so creating users is a small task. The other is huge and needs to have 300+ users created. I estimate ...
3
votes
2answers
2k views

How can I get an interface's bandwidth at any given second from the Linux command line?

I am doing a school project in which I want to get the bandwidth of a network interface at any given second, or some other small increment of time. I need this for a Perl script I am working on. ...
3
votes
1answer
653 views

Is there a reference to all Windows “errorlevel” by command?

Is there a reference to all Windows "errorlevel" by command? Looking for a page that defines all error levels, by command.
3
votes
2answers
4k views

Is there a way to get access to a window handle in windows using WSH, or WMI or similar?

Is there a way to get access to a window handle in windows using WSH, or WMI or similar? I just want to flag a window as always-on-top. Ideally I'd use windows script host for this. (Should also be ...
3
votes
1answer
2k views

How can I clear the scrollback buffer in konsole from bash?

I'm a heavy bash user and konsole is my preferred environment. I know I can use the keyboard command ctrl+shift+x to clear the scrollback buffer, but there's certain points in my scripts where I would ...
3
votes
3answers
235 views

How can I “invert” a directory structure?

I use a image processing tool which can batch output different sizes of the same image into the directory form: <specific directory>\<image size name> e.g. SuperBowl\Fullsize JPEG I ...
3
votes
1answer
99 views

#!/bin/bash -e :: what is `-e`? other arguments?

I am a shell script coder that always opt to use shell as top level as part of my belt in creating website apps on the fly and have relied on my bash scripts if I want a project to be implemented ...