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
2answers
266 views

Use of '#!' in *nix scripts

In many Apple/Unix scripts I see stuff preceeded by '#" which as far as I know means it is a remark. However often you see shell calls as below (the line with #!). ## Setting a default route ...
4
votes
7answers
11k views

How to convert .xlsx to .txt?

I want to know if there is a Linux tool or a script available to convert .xlsx file to .txt.
4
votes
6answers
9k views

How to make a statement that checks if something is divisible by something else without a remainder (BASH)

#!/bin/bash Echo “Enter a number” Read $number If [$number ] ; then Echo “Your number is divisible by 5” Else Echo “Your number is not divisible by 5” fi the if [$number] statement is what ...
4
votes
2answers
552 views

Need to truncate the %username% variable in windows 7 to seven characters

I use a script that generates a session name for out AS400 sessions based on the system %username%, the problem is that if the username is over 7 characters long the connection will fail. The session ...
4
votes
3answers
10k views

cmd.exe shortcuts and parameters

I have made a shortcut that opens cmd at a specific directroy How can I add a program to execute at the end of this statement? C:\Windows\System32\cmd.exe /k cd "C:\Program Files\App" I have ...
4
votes
1answer
12k views

What is a DDL script in the context of databases?

What is a DDL script in the context of databases?
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
5answers
12k views

Batch file to replace a single character in Windows filenames

I have a Windows Server 2003 server that has a whole bunch of filenames that need renaming. Basically, I just need all - (hyphens) replaced with _ (underscores), no matter where they are in the ...
4
votes
1answer
17k views

How to get filename only without path in windows command line?

for /r %f in (*) do echo %f Gives the output filename along with the entire path \path\to\dir\<filename> How do i get just the <filename> without the path included? I need to use that ...
4
votes
3answers
5k views

How to download this webpage with wget?

I want to download this webpage: http://forum.ubuntu-it.org/ but it require username and password. So I have used this wget --save-cookies cookies.txt --post-data ...
4
votes
5answers
1k 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
2answers
3k views

How do I configure Firefox through a script?

I'm looking to configure the following Firefox settings through a script (VBS or batch) default home page default search engine disable auto update Is this possible?
4
votes
1answer
4k 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
2answers
2k 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
4answers
129 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
146 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 ...
4
votes
3answers
3k views

How can I create a .zip file for each folder within another folder?

Under the folder images\, I have the following folders: Usa\ Italy\ Japan\ etc.. I want a script that creates a .zip for each of these folders, so I have usa.zip , italy.zip, japan.zip. How can ...
4
votes
2answers
4k views

Bash script to perform an action on each subdirectory in a directory

Assuming I have a directory structure like Dir1/ SubDir1/ SubDir2/ SubDir3/ I'd like to be able to pass 'Dir1' to a bash script and then perform an action on all of it's subdirectories ...
4
votes
3answers
1k 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
1answer
2k views

Generate html based on directory structure

does any one knows a linux based program/script that can generate html files based on directory structure?
4
votes
3answers
847 views

I want to execute the commands in a loop at the same time, not one after another

I'd like to write a loop ('for') that will do some action 'X' number of times. But instead of performing the actions sequentially, one after another, I'd like them to execute simultaneously (in ...
4
votes
3answers
3k 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
6answers
2k views

Dos and/or Windows versions of Unix SCRIPT command

Back in university, when we had to submit an assignment in CS, we would have to perform a series of steps including running script, date, whoami, etc., and then running our program. The script ...
4
votes
6answers
6k views

Launch synergy client on boot in Mac OS X

I have a mac as a secondary machine at work. Currently I use synergy on my main machine to share its keyboard and mouse with the mac. I created a launch agent for my user to launch synergy when I ...
4
votes
1answer
1k views

noscript, how to allow script on one domain only?

Some forums allow direct embedding of YouTube videos, and it's slowing down my browsing a lot when a user posts several videos in a single post. I want to allow YouTube's script only on youtube.com, ...
4
votes
1answer
2k 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
2k 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
319 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
765 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
5answers
2k views

zipping all files/dirs in a directory except some?

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
1answer
265 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
583 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
2answers
178 views

Custom Gmail color theme

I hate Gmail's new color themes. I am looking for a way to change it back to the older color theme. Does anyone know any GreaseMonkey script or Firefox addon to do this?
4
votes
5answers
689 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
3answers
741 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
2answers
297 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
288 views

How to create keyboard shortcuts for URLs, with parameters added in?

As part of my job, I frequently have to visit several URLs that have the exact same address, except for one word. So for example, in one day, I'll visit the following sites over and over again: ...
4
votes
1answer
953 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
4answers
6k views

How to run a script at shutdown with Snow Leopard?

I want to run a script when I shutdown or restart my iMac, running Snow Leopard. I read somewhere that one could use the /etc/rc.shutdown.local for this, but it is not working for me. For example, I ...
4
votes
3answers
622 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
111 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
259 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
2answers
960 views

How can I tell if OS X is connected to a VPN network from the command line?

How can I tell if OS X is connected to a VPN network from the command line? By running ifconfig without any arguments when I am connected, I see that there is a utun0 interface which appears to be ...
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
4answers
10k views

Run AppleScript on startup (background)

I want to run a apple-script on Mac OS X on startup. The script shall run during the complete lifetime of the user session. What is the best solution to do this? My Script: on idle do shell ...
3
votes
5answers
709 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
432 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
3answers
11k views

Does anyone have a Mac Terminal script to remove hidden files?

My car stereo can play music from USB flash drives, so I asked about copying MP3s from an iTunes playlist. That worked fine, but my stereo wouldn't play the MP3 files. I eventually put the flash ...
3
votes
4answers
4k views

Setting ID3 title tag to be equal to MP3 file name

Has anyone got a bash script that will go through a media library and set the id3 title tag of each MP3 file to be equal to the file's name? I'm open to other automated methods too. It can be a GUI ...
3
votes
3answers
795 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 ...