Sponsored Content
Top Forums Shell Programming and Scripting Adding a while loop to my script Post 302582332 by binary-ninja on Thursday 15th of December 2011 02:20:00 PM
Old 12-15-2011
Adding a while loop to my script

I have a script below that goes to the given directory and plays the newest powerpoint presentation via powerpoint viewer and wine.
So far it works perfectly but now Id like to add a while statement to essentially run
Code:
find /ticker/powerpointshare -mmin -1 -type f -iname "*.ppt"

and if it finds a file then execute the top half of my script again.


Code:
#! /bin/sh

# Start the newest Powerpoint presentation

# Change Directory to /ticker/powerpointshare
cd /ticker/powerpointshare

# Creates the variable newppt for use in this script
# ls -tr sorts the the ls output and pipes in into tail to grab the newest file 
newppt=$(ls -tr | tail -1)

echo This is the newest powerpoint presentation
echo $newppt
cd /ticker/powerpointshare

# We use wine to open the powerpoint presentation  with Powerpoint Viewer 2007
wine "C:\Program Files\Microsoft Office\Office12\PPTVIEW.EXE" /N $newppt

exit

 

10 More Discussions You Might Find Interesting

1. Programming

adding variables for, for loop

I have a structure which contains n number of elements. For example: stFruits : apple, grapes, strawberry, pear, kiwi, melon, papaya, mango, orange, sweetlime ..... etc Now i have to write a for loop as follows: int i; int j; j=stFruits.apple+stFruits.grapes+stFruits.pear+.... and so... (3 Replies)
Discussion started by: jazz
3 Replies

2. Shell Programming and Scripting

adding values with a loop

Hi there, I am checking disk spaced used on a box # df -k | grep dsk | awk {'print $3'} 2055463 20165785 18310202 32274406 I want to somehow add them up but am no quite sure how to do this in a loop. ...i.e for n in 'df -k | grep dsk | awk {'print $3}' do <some adding... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

3. Shell Programming and Scripting

Adding a Fileinput loop to exsiting script.

:confused: I'm very confused on what I need to do. I've looked at if, while, but I can't seem to visualize where in my current script to put the commands. I'm looking to read a directory /ERD/iface/data/ocom/citi/idd because there will be multible files, but I need to process them one at a time.... (2 Replies)
Discussion started by: netmad0
2 Replies

4. Shell Programming and Scripting

doing a for loop adding up the results

Hi there If I run a 'swap -l' on my solaris box, i get swapfile dev swaplo blocks free /dev/dsk/c1t0d0s1 54,65 8 67119560 65655144 /dev/dsk/c1t0d0s2 54,65 8 33119522 32655122 I wanted to run a for loop adding up the totals of each column 4 , excluding the... (2 Replies)
Discussion started by: hcclnoodles
2 Replies

5. Shell Programming and Scripting

Adding string variable dynamically in for loop

Hi, I need to generate the text name dynamically in for loop, ex, VAR_COPY_FILE1= file path 1 VAR_COPY_FILE2= file path 2 VAR_COPY_FILE3= file path 3 for i in 1 2 3 do if then "do some process here" fi done (3 Replies)
Discussion started by: msubash26
3 Replies

6. Shell Programming and Scripting

adding counter to a variable while moving in a loop

The scenario is like this : I need to read records from a file one by one and increment counter1, if a certain field matches with a number say "40"..the script should increment the counter2 and also extract a corresponding field from the same line and adding them one by one and redirecting the the... (5 Replies)
Discussion started by: mady135
5 Replies

7. Shell Programming and Scripting

Help needed: Adding columns in csv file in loop

Hi Everyone: My shell script creates multiple csv files (~30) in for loop. I want to compile (or merge) 3rd column from each (all) of these files to another file (in loop). Please help. Thanks. (3 Replies)
Discussion started by: smap007
3 Replies

8. Shell Programming and Scripting

Bash: adding commas in for loop

Dear Experts I think this is possibly the easiest thing. but I am not able to solve: I need comma to be added to end of each line echo'd. But does not want it to be added to last line. I have a script which does some data analysis and creates a command as in below code snippet for... (4 Replies)
Discussion started by: chakrapani
4 Replies

9. Shell Programming and Scripting

adding one more column in a loop

data1 1 0.01 3 5 1 0.6 2 1 data2 2 0.02 3 5 2 0.3 2 1 data3 3 0.01 3 5 3 0.01 2 1 output 1 0.01 data1 2 0.02 data2 3 0.01 data3 3 0.01 data3 I want to print 1st, 2nd column and the filename when second column is less than 5. (3 Replies)
Discussion started by: johnkim0806
3 Replies

10. Shell Programming and Scripting

Help on Adding one counter loop at the end of each line in a file

Hello All, I have file a.txt I want to add a counter loop at the end of each line in a file ill explain: i have a site h**p://test.test=Elite#1 i want to add a a counter to the number at the end of the file, that it will be like this urlLink//test.test=Elite#1 urlLink//test.test=Elite#2... (3 Replies)
Discussion started by: nexsus
3 Replies
WINESERVER(1)							  Windows on Unix						     WINESERVER(1)

NAME
wineserver - the Wine server SYNOPSIS
wineserver [options] DESCRIPTION
wineserver is a daemon process that provides to Wine roughly the same services that the Windows kernel provides on Windows. wineserver is normally launched automatically when starting wine(1), so you shouldn't have to worry about it. In some cases however, it can be useful to start wineserver explicitly with different options, as explained below. OPTIONS
-d[n], --debug[=n] Set the debug level to n. 0 means no debugging information, 1 is the normal level, and 2 is for extra verbose debugging. If n is not specified, the default is 1. The debug output will be sent to stderr. wine(1) will automatically set the debug level when start- ing wineserver if the +server option is set in the WINEDEBUG variable. -f, --foreground Make the server remain in the foreground for easier debugging, for instance when running it under a debugger. -h, --help Display a help message. -k[n], --kill[=n] Kill the currently running wineserver, optionally by sending signal n. If no signal is specified, sends a SIGINT first and then a SIGKILL. The instance of wineserver that is killed is selected based on the WINEPREFIX environment variable. -p[n], --persistent[=n] Specify the wineserver persistence delay, i.e. the amount of time that the server will keep running when all client processes have terminated. This avoids the cost of shutting down and starting again when programs are launched in quick succession. The timeout n is in seconds, the default value is 3 seconds. If n is not specified, the server stays around forever. -v, --version Display version information and exit. -w, --wait Wait until the currently running wineserver terminates. ENVIRONMENT VARIABLES
WINEPREFIX If set, the content of this variable is taken as the name of the directory where wineserver stores its data (the default is $HOME/.wine). All wine processes using the same wineserver (i.e.: same user) share certain things like registry, shared memory and kernel objects. By setting WINEPREFIX to different values for different Wine processes, it is possible to run a number of truly independent Wine sessions. WINESERVER Specifies the path and name of the wineserver binary that will be launched automatically by wine. If not set, wine will try to load /usr/bin/wineserver, and if this doesn't exist it will then look for a file named wineserver in the path and in a few other likely locations. FILES
~/.wine Directory containing user specific data managed by wine. /tmp/.wine-uid The directory containing the server Unix socket and the lock file. These files are created in a subdirectory generated from the WINEPREFIX directory device and inode numbers. AUTHORS
The original author of wineserver is Alexandre Julliard. Many other people have contributed new features and bug fixes. Please check the file Changelog in the Wine distribution for the complete details. BUGS
If you find a bug, please submit a bug report at http://bugs.winehq.org. <http://bugs.winehq.org> AVAILABILITY
wineserver is part of the Wine distribution, which is available through WineHQ, the Wine development headquarters, at http://www.winehq.org/. <http://www.winehq.org/> SEE ALSO
wine(1). Wine 1.2-rc6 October 2005 WINESERVER(1)
All times are GMT -4. The time now is 07:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy