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
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
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 ...
2
votes
1answer
66 views

Creating directory name from file name - strip out non alpha numeric characters and make lower case

I am able to create a directory based on the name of a file. I am running into a wall if the text has spaces or non alpha numeric characters. I would like to strip out those non alpha numeric ...
2
votes
2answers
5k 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 ...
2
votes
1answer
566 views

Copy all files in folder and subfolders to single folder - with duplicate handling

I need to copy all files in a folder and it's subfolders to a single folder, without copying the subfolders. From searching stackexchange, I've found this script: for /f "tokens=*" %a in ('dir /b /s ...
2
votes
3answers
735 views

Can I use a bash script as a Service in OS X without having to set it up trough automator?

How can I use a bash script as a Service in OS X without having to set it up trough automator? I'd basically like to write a bash script, save it in ~/Library/Services and then just have it show up ...
2
votes
1answer
1k views

Shell script to rename multiple files from their parent folders name

I have a file structure like this: 00000010 000000001.file1 000000001.file2 00000020 00000003.file1 00000003.file2 00000003.file3 ... So there are folders with 8-digit names containing one ...
2
votes
1answer
1k views

Checking VBScript for syntax errors without actually running the script

I have a script in VBScript. I'm not sure if it contains any syntax errors or other non-runtime errors. Normally I would just run the script, but I don't want the script to actually run because the ...
2
votes
3answers
1k views

how to stop bash from printing alerts?

When killing a process with kill -9 $PID &>/dev/null in a script, a message is still printed to the terminal after the next command terminates. How do you stop this behaviour? For example ...
2
votes
2answers
3k views

Is it possible to access the shell (Darwin) on an iPhone?

In order to write some little script for example.
2
votes
2answers
9k views

Starting a script on xfce login and logout?

I use xfce4 as my desktop environment, running on a Gentoo box. I want to start the pulseaudio server when I login. In general, how do I get a script to run as soon as I login to xfce, and how do I ...
1
vote
2answers
985 views

How can I write a script to count files modified within a particular month?

I use a PowerShell command to count ZIP files modified within the past 30-ish days, that goes something like this: (gci "\\servername\sharename\foldername\subfoldername\*.zip" | where ...
1
vote
1answer
2k views

How to burn a cd (files not iso) from the command line in Windows 7

I have used robocopy and a script to copy files from various resources. I now want to have my script automatically burn the files I copied to a cd. I'm looking for a command. I have tried xcopy but I ...
1
vote
2answers
3k views

How do I open a random file in a folder, and set that only files with the specified filename extension(s) should be opened?

How do I open a random file in a folder, and set that only files with the specified filename extension(s) should be opened? (While preferably, supporting Unicode filenames too.) I've already looked ...
1
vote
1answer
7k views

Batch file script for Enable & disable the “use automatic Configuration Script”

My intention is to create a .bat file that toggles the check box of "use automatic Configuration Script" in Internet Settings. The following is my script @echo OFF setlocal ENABLEEXTENSIONS set ...
1
vote
1answer
430 views

Simulate pgrep using plain grep

How can I do pgrep -U someUserName using just ps and grep? I.e. not count on pgrep being set in a system?
1
vote
0answers
1k views

Macintosh OS X Logout Script

I am working on a project where I need to implement a logout script on some Macintosh computers. I have read the following Create a logoff script/task for Mac OS X article and found that while it is ...
1
vote
3answers
2k views

Linux get single bandwidth usage sample

What I want to do is to write a script that gathers some information (like cpu temperature and bandwidth usage) and logs it into a file. I can't figure out how to get a single sample of the current ...
1
vote
1answer
568 views

String manipulation in Grub2

One of the new features of Grub2 is scriptability. At my work we're using it to great affect. However, I recent stumbled on a terrible short coming. There isn't any string manipulation or ...
1
vote
3answers
2k views

How can I script making a backup of recently modified files in Bash?

I have written this backup script that looks in a file and copies recent files into a folder. #!/usr/bin/bash # the number of days to do the backup for. days=2; # the files to backup. ...
1
vote
3answers
1k views

RSS feed reader that supports filtering? [closed]

In the past I have been using Akregator and GoogleReader to read my RSS feeds. The latter is particularly interesting as I am not right to a single computer and that it supports social sharing. ...
1
vote
2answers
3k views

FTP script won't transfer remote files to local computer

This is a follow up to FTP BAT file - Windows Scheduled Task. I copied the FTP script, but I can't transfer the files to my local computer. All I get is this (server address omitted): 331 ...
0
votes
0answers
246 views

FireFox's NoScript equivalent for IE 11 in Windows 8.1

For my IE 11 in Windows 8, I need a tool I can use to disable/enable JavaScripts on various web pages dynamically when I open a web page - something similar to what the NoScript plugin for FireFox ...
0
votes
1answer
133 views

How to start GUI application with upstart?

I have struggled with this problem for three days and I have tried many ways to solve it but not successful yet. I hope you guys can help me... I have an GUI application. I want to start this ...
0
votes
1answer
136 views

Postgresql starup script for second instance?

I need to run my second postgresql instance when linux boots. I added this command (like in postgresql documentation) in rc.local: /usr/lib/postgresql/9.1/bin/pg_ctl start -l logfile -D ...
0
votes
1answer
231 views

running for loop - but wait for string of words in log file to continue

so far I have this: for each in {01..10} ; do ./sb0$each/tomcat_sb0$each start;done that will start my apps at once, but I want it to wait until it reads one line in a file, what's the easiest way ...
0
votes
3answers
470 views

Scripts shell recording playback

I hope this makes sense. I use 'scripts' to make copies of my ssh sessions for various reasons. When I access the logs via less, etc, I see this: Script started on Mon 12 Sep 2011 08:59:14 AM CDT ...
0
votes
2answers
607 views

Linux rename using parameters and spaces?

Is it possible, in Linux, to rename a file from something without spaces to something containing spaces? I know I can create directories and files with spaces by doing: mkdir "new dir" and: touch ...