Sponsored Content
Top Forums Shell Programming and Scripting Error in script confirmed and to be continued Post 302449348 by ave-phoenix on Monday 30th of August 2010 09:51:29 AM
Old 08-30-2010
Error in script confirmed and to be continued

Hello.

I have a problem.

When i run 1.sh, ask me yes or no, and, if i asnwerd yes, there continue the procediment
Code:
"sudo -u root echo hello"

. All without putting it into a single script, and who uses the confirm many more scripts.


I have two script.
============
1 with the following code confirm.sh
#################################
Code:
#!/bin/bash
while true; do
    echo
    read -p "esta seguro de hacer lo que sea que vaya a hacer (yes/n)" yn
    case $yn in
        yes ) break;;
        not ) exit;;
        * ) echo "por favor responda yes o no";;
    esac
done

2º script 1.sh
#######
Code:
confirm.sh normal ("sudo-u root stopserver.sh")


Last edited by ave-phoenix; 08-30-2010 at 11:29 AM..
 

4 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Scrolling text continued

Perderabo * Unix Daemon * Join Date: Aug 2001 Location: Ashburn, Virginia Posts: 9,071 Using head and tail like that is terribly inefficient. I decided to try a rewrite. Sheesh...I spent all morning on this.... Code: #! /usr/bin/ksh # # scroller --- display text, but sleep every... (0 Replies)
Discussion started by: jamesapp
0 Replies

2. Shell Programming and Scripting

Parallel processing - continued

Hi, I am taking up the cue from where I was left in my earlier post ( link given below ) https://www.unix.com/shell-programming-scripting/231107-implement-parallel-processing.html I actually wanted to know the significance of using the Unix "wait" , which returns the control from background to... (3 Replies)
Discussion started by: kumarjt
3 Replies

3. Linux

Debian Grub 1.99 alters BIOS (confirmed after formatting hard disk)

Hi, I am a long time Windows user and recently try this Debian Wheezy OS. Burn Debian ISO in Windows environment and then select DVD ROM drive to boot first in BIOS. The first installation of Debian (GNOME) was with multi-boot option that allows booting from hard disk and DVD drive. I then... (4 Replies)
Discussion started by: Linuxmun
4 Replies

4. Shell Programming and Scripting

Reading a long literal continued next line

I am trying to identify all messages or prompts from a number of COBOL programs and they can usually be identified by a pair of double quotes on one line. However, sometimes the literal will not be finished on the first line but after a dash in column 7 of the next line, the literal will be... (6 Replies)
Discussion started by: wbport
6 Replies
bup-margin(1)						      General Commands Manual						     bup-margin(1)

NAME
bup-margin - figure out your deduplication safety margin SYNOPSIS
bup margin [options...] DESCRIPTION
bup margin iterates through all objects in your bup repository, calculating the largest number of prefix bits shared between any two entries. This number, n, identifies the longest subset of SHA-1 you could use and still encounter a collision between your object ids. For example, one system that was tested had a collection of 11 million objects (70 GB), and bup margin returned 45. That means a 46-bit hash would be sufficient to avoid all collisions among that set of objects; each object in that repository could be uniquely identified by its first 46 bits. The number of bits needed seems to increase by about 1 or 2 for every doubling of the number of objects. Since SHA-1 hashes have 160 bits, that leaves 115 bits of margin. Of course, because SHA-1 hashes are essentially random, it's theoretically possible to use many more bits with far fewer objects. If you're paranoid about the possibility of SHA-1 collisions, you can monitor your repository by running bup margin occasionally to see if you're getting dangerously close to 160 bits. OPTIONS
--predict Guess the offset into each index file where a particular object will appear, and report the maximum deviation of the correct answer from the guess. This is potentially useful for tuning an interpolation search algorithm. --ignore-midx don't use .midx files, use only .idx files. This is only really useful when used with --predict. EXAMPLE
$ bup margin Reading indexes: 100.00% (1612581/1612581), done. 40 40 matching prefix bits 1.94 bits per doubling 120 bits (61.86 doublings) remaining 4.19338e+18 times larger is possible Everyone on earth could have 625878182 data sets like yours, all in one repository, and we would expect 1 object collision. $ bup margin --predict PackIdxList: using 1 index. Reading indexes: 100.00% (1612581/1612581), done. 915 of 1612581 (0.057%) SEE ALSO
bup-midx(1), bup-save(1) BUP
Part of the bup(1) suite. AUTHORS
Avery Pennarun <apenwarr@gmail.com>. Bup unknown- bup-margin(1)
All times are GMT -4. The time now is 11:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy