Sponsored Content
Special Forums Windows & DOS: Issues & Discussions "background processes" in Windows Post 302912881 by Corona688 on Tuesday 12th of August 2014 12:03:37 PM
Old 08-12-2014
"background processes" in Windows

In order to prevent my Windows machine from trying to start umpteen different applications simultaneously and thrashing to oblivion, I have written this script:

Code:
#!/bin/sh

TODAYFILE="$USERPROFILE/My Documents/$(date +%b%d-%Y.txt)"

[ -e "$TODAYFILE" ] ||
        touch "$TODAYFILE"

# ( notepad.exe "$TODAYFILE" ) &

cd "$USERPROFILE/Start Menu/Programs/Delayed-Start" || exit 1

set -- *.*

while [ "$#" -gt 0 ]
do
        printf "Starting %30s\r" "$1"
        case "$1" in
        *.[sS][hH])
                sh ./"$1" &
                ;;
        *)
                cmd /C "$1" &
                [ -z "$2" ] || sleep 45
                ;;
        esac

        shift
done

echo Done

It is executed by a batch file in my 'Startup' items (and Busybox's help.). It looks for script files, lnk files, or anything else inside my own 'Delayed Start' menu and waits 45 seconds between starting each application, in alphabetical order. I name them 1-firstapp 2-secondapp etc to determine the order.

You will notice one commented out line:
Code:
# ( notepad.exe "$TODAYFILE" ) &

This is because Notepad, unlike most "big" apps, doesn't put itself into the background -- and I can't force it to do so, even with & and a subshell. I guess this is something Windows must do, not something a mere script has power over.

How can I convince Windows to do this?
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

How to include RETURN KEY with Background process "&" in Shell Script

Hello All, I am a newbie in Shell script programming, and maybe you can help me with my query. I need to write a shell script (mntServer.ksh) that will start a background process and also to be able to run another script. The mntServer.ksh script contains: #!/bin/ksh... (1 Reply)
Discussion started by: racbern
1 Replies

3. Windows & DOS: Issues & Discussions

Unix "cut' and "awk" in Windows XP?

Hi, How can I execute Unix's ksh equivalent of "cut' and "awk" in Windows XP? For example, I want to execute ksh commands from Windows command prompt. Is there a place I can download "cut.exe" and "awk.exe" ? Thanks in advance (4 Replies)
Discussion started by: ihot
4 Replies

4. Windows & DOS: Issues & Discussions

"Striping" the background of an Rxvt/Urxvt window in Cygwin

To get this: https://www.unix.com/members/silversleevesx-albums-incidental-shot-glass-picture127-termshot-rxvt-rootless.png out of Cygwin's rxvt, you have to tweak your /cygwin/etc/x11/app-defaults/rxvt file, which is here:... (0 Replies)
Discussion started by: SilversleevesX
0 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

[SOLVED] Using "$!" to get the PID of the Last Ran Background Process

Hello All, I was looking into creating a script that would be used only to start a Daemon and create a lock file... F.Y.I. It's for Nagios' NRPE Daemon Plugin... Anyway when I run the command to start the Daemon (below): /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d And... (14 Replies)
Discussion started by: mrm5102
14 Replies

7. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

8. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

9. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies
esniper(1)						      General Commands Manual							esniper(1)

NAME
esniper - a lightweight ebay sniping tool SYNOPSIS
esniper [-bdhHimnPrUv] [-c conf_file] [-l logdir] [-p proxy] [-q quantity] [-s secs|now] [-u user] (auction_file | [ auction price ... ]) DESCRIPTION
esniper is a lightweight ebay sniping tool. It doesn't have a lot of features, and that is by design. Auctions are specified on the command line, using the auction number and your bid price. Multiple auctions can be bid on by specifying more auctions and bid prices. esniper stops when the desired quantity has been won (default is 1). You can use an auction file instead of specifying auctions on the command line. See the AUCTION FILE section below for more details. OPTIONS
-b Enable batch mode. The corresponding configuration option is batch, default value is false. In batch mode, esniper never prompts for password and/or username. If the password or username cannot be determined from options or read from configuration or auction files, esniper will fail. -c Specifies a configuration file to read. All options can be set either by command-line flags or in the configuration file. See the CONFIGURATION FILE section for details. The default configuration file is $HOME/.esniper (or $USERPROFILE/My Documents/.esniper in Windows). -d Enable debug mode. The corresponding configuration option is debug, default value is false. Log files are named esniper.<auc- tion_num>.log and esniper.log, and are written to the current working directory. If the -l option or logdir configuration option is used, log files are written to the specified directory. -h Show command line option help. -H Show configuration and auction file help. -i Print information on given auctions and exit. -l Set the directory where log files will be written. The corresponding configuration option is logdir, default value is the current working directory, or if an auction file is specified the directory of the auction file. The directory must exist and be writeable. Log files are written when the -d option is used. -m Print user's my eBay watched items list and exit. The user's myEbay watched items list must use the default column ordering. -n Do not bid. The corresponding configuration option is bid, default value is true. Useful for debugging, it exercises most of esniper except actually placing bids. It is also be useful for checking the status of an auction, without accidentally placing a bid. -p Specify an http proxy to use. The corresponding configuration option is proxy, default value is the value of the http_proxy envi- ronment variable. The proxy should be of the form http://host:port/. -P Prompt the user for their ebay password. This overrides the password set in any configuration or auction file. -q Set the quantity. The corresponding configuration option is quantity, default value is 1. esniper will quit when it has won enough items. -r Do not reduce quantity on startup for items you have already won. The corresponding configuration option is reduce, default value is true. -s Set the bidding time, specified as now, or seconds before the end of an auction. If now is used, bids will be placed immediately. The corresponding configuration option is seconds, default value is 10 seconds. You should snipe late enough in an auction to pre- vent a manual bidder to update their bid, but before other snipes. In case two bids are within one bid increment of each other, the first bid placed wins. -u Set the ebay username. The corresponding configuration option is username, there is no default value. -U Prompt the user for their ebay username. -v Print version and exit. CONFIGURATION FILE
Most command-line options can also be set in a configuration file. The advantage of using a configuration file is that you can set all of you options once and not have to enter them on the command line every time you run esniper. A configuration file consists of option lines, in the format "option=value", blank lines, and comments. Option names are listed above with their corresponding command-line flags. Comments begin with #. One configuration file option that doesn't have a corresponding command-line flag is password. The password option allows you to set your eBay password. If you store your eBay password in a configuration file, you should ensure that the configuration file can be read only by you. The default configuration file is $HOME/.esniper (or $USERPROFILE/My Documents/.esniper in Windows). If an auction file is used, esniper will also attempt to read .esniper from the directory that contains the auction file; options set in this configuration file will override options set in the user's default configuration file. However, if the -c command line option is used, then only the configuration file specified by the -c command line option is read. Options specified on the command line override corresponding options set in an auction file, and options set in an auction file override options set in any configuration file. AUCTION FILE
An auction file is similar to a configuration file, but it also has one or more auction lines. An auction line contains an auction number, optionally followed by a bid price. If no bid price is given, the auction number uses the bid price of the first prior auction line that contains a bid price. If an auction file is specified and the -c option isn't used, esniper attempts to read .esniper from the directory where the auction file is located. See the CONFIGURATION FILE section for more details. EXAMPLES
An example of a configuration file: # A configuration file contains option settings, # blank lines, and comments (begin with #). The # default configuration file is $HOME/.esniper, and # if you specify an auction file, .esniper in the # auction file's directory as well. If you specify a # configuration file using the -c command-line option, # then that configuration file will be the only one # read. # # If you set your password in a configuration file # and you are on a unix system, you should be the # owner of the file, and you should set the # permissions so that it is readable only by the # owner. # # Here are all the options. Note that if the # default (as defined in esniper -H) is fine, you # don't need to specify it in a configuration file. # boolean parameters can be set to: # true, y, yes, on, 1, enabled # false, n, no, off, 0, disabled batch = false bid = yes debug = enabled reduce = y # Note: it would be nice if logdir could use ~myuser, # or $HOME. Perhaps in a future version. logdir = /export/home/myuser/esniperlogs password = myebaypassword # Note: proxy authentication not yet supported proxy = http://192.168.1.1:8080/ username = myebayusername # Note: quantity is usually set in an auction file quantity = 1 # Note: seconds can also be "now", if you want to # bid immediately seconds = 10 An example of an auction file: # An auction file may contain any line that is valid # in a configuration file (see sample_config.txt for # details), plus it may also have auction lines. # # An auction line contains an auction number, optionally # followed by a price. If a price isn't specified, the # price used is the same as the previous auction line. # # You should have one auction file for each type of item # you are bidding on, so that you can change the quantity, # username, or other options to suit the item you are # bidding on. For instance, you may want to buy up to 10 # laser print cartridges, but only one digital camera. # Sample auction file for laser printer cartridges # I'd like 10 of them, and my target price is $50 quantity = 10 # seller surpluslaserjunk, shipping $15, # questionable reputation (so I'll only pay $40 total) 9298389738 25 9872749829 9872972987 9087289973 # seller highqualityprintersupplies, shipping $8, # excellent reputation 9982309829 42 9827349827 # seller nonbusinesshomeseller, shipping not mentioned # (assume $10), good reputation 9287398473 35 # seller lasersuppliesforcheap, lousy reputation, # don't buy!!! #9239889372 0 ENVIRONMENT VARIABLES
http_proxy The default http proxy. The -p command-line option and proxy configuration option override this setting. USERPROFILE Windows user's home directory. If no configuration file is specified, esniper tries to read the file My Documents/.esniper under the USERPROFILE directory. Note: esniper for Windows 95, 98 and Me is compiled under cygwin, a unix-like environment for Windows. This version of esniper uses the HOME environment variable, as described below. HOME Unix user's home directory. If no configuration file is specified, esniper tries to read the file .esniper in this direc- tory. BUGS
eBay likes to change their website often. Some of these changes will break esniper. If esniper doesn't work for you, please make sure you have the most recent version. You can check the version of esniper you are using by running esniper with the -v option. Updates to esniper are available at http://esniper.sf.net/. If you are running the most current version and you are still encountering a bug, please report the bug at http://esniper.sf.net/. To keep up to date with new releases and major bugs, subscribe to the esniper announce mailing list at http://lists.sf.net/lists/listinfo/esniper- announce THANKS
Many thanks to all contributors and users. AUTHOR
Copyright (C) 2002, 2003, 2004 Scott Nicol <esniper@users.sf.net> All rights reserved. 31 Jan 2005 esniper(1)
All times are GMT -4. The time now is 04:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy