Sponsored Content
Homework and Emergencies Homework & Coursework Questions How to use loop to repeat task? Post 302869229 by Don Cragun on Wednesday 30th of October 2013 12:02:51 AM
Old 10-30-2013
What shell are you using? (Some shells can perform floating point arithmetic without calling bc.)

Look at the man page on your system for the shell you're using. Search it for descriptions of the syntax of its for loop and while loop compound commands.

Consider adding a third choice to your menu to exit the loop when the user has completed calculating order totals.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Repeat Commands

On my system I use Escape "k" to go back in commands. I read on tutorials that it is ctrl p, but that does not work on my system. Anyone know what the command to go foward is? (6 Replies)
Discussion started by: dereckbc
6 Replies

2. Shell Programming and Scripting

to copy and repeat

Hi All, I have done some looking at other threads but haven't found quite what I am looking for. I am a newbie to scripting and haven't got to where I want to you but here is my basic question. I have a script to copy a file and send it to another file with a date and time stamp. What I want to... (4 Replies)
Discussion started by: falcondown01
4 Replies

3. Shell Programming and Scripting

comment and Uncomment single task out of multiple task

I have a file contains TASK gsnmpproxy { CommandLine = $SMCHOME/bin/gsnmpProxy.exe } TASK gsnmpdbgui { CommandLine = $SMCHOME/bin/gsnmpdbgui.exe I would like to comment and than uncomment specific task eg TASK gsnmpproxy Pls suggest how to do in shell script (9 Replies)
Discussion started by: madhusmita
9 Replies

4. UNIX for Dummies Questions & Answers

repeat each record n times

I have: aa01 aa02 aa03 aa04 ab01 ab02 ab03 ab04 I would like each record printed 5 times: aa01 aa01 aa01 aa01 aa01 aa02 aa02 (6 Replies)
Discussion started by: kenneth.mcbride
6 Replies

5. Shell Programming and Scripting

Parse an XML task list to create each task.xml file

I have an task definition listing xml file that contains a list of tasks such as <TASKLIST <TASK definition="Completion date" id="Taskname1" Some other <CODE name="Code12" <Parameter pname="Dog" input="5.6" units="feet" etc /Parameter> <Parameter... (3 Replies)
Discussion started by: MissI
3 Replies

6. Shell Programming and Scripting

case loop... repeat on bad input?

I'm trying to get a case statement to start over if an undefined option is selected... But I am ata loss on how to actually do it. Here is a quick example of what I have. Echo "1) do this/n 2) Do that/n 3) Quit/n Make a selection/n" Read answer Case answer in 1) Dothid;; 2) Dothat;;... (3 Replies)
Discussion started by: trey85stang
3 Replies

7. Shell Programming and Scripting

Repeat using for loop

I have a file like this 2011-10-10 10:46:00,1-1-13-1-1,151510,ALCLA0A84D2C 2011-10-10 10:46:00,1-1-13-1-1,151520,65537 2011-10-10 10:46:00,1-1-13-1-1,151515,46932 2011-10-10 10:46:00,1-1-13-1-1,151521,32769 2011-10-10 10:46:00,1-1-13-1-1,151522,32769 2011-10-10... (4 Replies)
Discussion started by: LavanyaP
4 Replies

8. Shell Programming and Scripting

Ping and repeat ?

How do i write a loop ping to see if it get timeout or hang ? it should loop every 30 second to ping a server ? ping -c 5 -t 15 www.google.com if ]; then date '+%Y-%m-%d %H:%M:%S Connection Unavailable' >> /home/sabercats/checkconnection.log else date '+%Y-%m-%d %H:%M:%S Connection... (3 Replies)
Discussion started by: sabercats
3 Replies

9. Shell Programming and Scripting

Repeat for different variable

Hey, I've created following script: var1=test1 setA=testA if ... touch $setA/$var1 ... fi I would like now the repeat the command touch (in this example) for different variables. So below, the varX should run 3 times (var1, var2, var4). Var3 is skipped in this example... (4 Replies)
Discussion started by: brononius
4 Replies

10. Homework & Coursework Questions

How to use xargs to repeat as a loop to grab date string?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: My goal to find how many requests in 14 days from weblog server. I know to cat a weblog file to wc -l to find the... (8 Replies)
Discussion started by: scopiop
8 Replies
smd-pull(1)						 Sync Mail Dir (smd) documentation					       smd-pull(1)

NAME
smd-pull - syncs the local mail dir letting the remote one untouched SYNOPSIS
smd-pull [-d|--dry-run] [-v|--verbose] [-s|--show-tags] [-t|--template-only] [-n|--no-delete] [endpoint] DESCRIPTION
smd-pull performs in the local maildir all the changes that were performed on remote one. No changes are made on the remote maildir. Use smd-push(1) for that. Refer to smd-config(5) for the configuration file format. OPTIONS
-v --verbose Verbose output -s --show-tags Machine readable output -d --dry-run Do not perform any action for real -n --no-delete Do not propagate deletions -t --template-only Just create a template configuration file if none endpoint Is the suffix for the name of the configuration file to use. If it is omitted, the configuration file ~/.smd/config.default is used. FILES
~/.smd/config.* ~/.smd/hooks/pre-pull.d/ ~/.smd/hooks/post-pull.d/ SEE ALSO
mddiff(1), smd-server(1), smd-client(1), smd-push(1), smd-loop(1), smd-config(5) AUTHOR
Enrico Tassi <gares@fettunta.org> 11 June 2012 smd-pull(1)
All times are GMT -4. The time now is 06:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy