01-24-2002
Copy error message....
When the promt "Enter file name to be copied" comes up press enter (return), I get an error message, is there a new of getting rid of it or round it??
Copyfile () {
print -n "Enter file name to be copied: "
read sourcefile
if test ! -f $sourcefile
then
echo "File doesnt exist, press enter"
read answer
else
print -n "Enter name of new file that will hold contents of "$sourcefile
read targetfile
if test -f $targetfile
then
echo "The name: $targetfile is already in use"
else
cp $sourcefile $targetfile
echo "$sourcefile copied"
print -n "Do u want to repeat, and copy another"
read answer
case $answer in
[yY]) Copyfile ;;
[nN]) break ;;
*) echo " Do you want to repeat (y/n)?? "
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
Here is an example of a problem I have:
File2: contain the following lines:
a^ aaa^aa aa^~
b^ bbb^bb bb^~
c^ ccc^cc cc^~
d^ dddd^dd dd^~
File1: contain the following lines:
b^ bbb^bb bb^~
c^ ccc^cc cc^~
I get File2 as input and I want to do as following:
for each line in... (3 Replies)
Discussion started by: hellsd
3 Replies
2. UNIX for Dummies Questions & Answers
I'm have some trouble, I'm doing some unix stuff for fun and I can't get something to work
I have a getquote.sh script:
wget "http://finance.yahoo.com/q?s=$1" -o /dev/null -O quote
echo `echo $1; egrep "Last Trade:" quote | cut -d ">" -f 3 | cut -d "<" -f 1`
to get the current trading price... (1 Reply)
Discussion started by: hinch
1 Replies
3. Shell Programming and Scripting
Hi Can anybody please explain how the below script works and if there is any problems with it? The script is part of an archival process but it keeps crashing out.
#!/sbin/sh -
clear
purgelist="/var/opt/moto/live/scripts/old_messages_purge_list"
for i in `cat $purgelist`
do
... (2 Replies)
Discussion started by: runnerpaul
2 Replies
4. Shell Programming and Scripting
i have two problems with my phone book script the first i want to only allow a valid name if it has letters and spaces not a number in the name. so "joe smith" is ok "joe smith1" is not ok.
the second problem is how can i cut a name out of a txt file i have this as my test txt file
joe blogs... (3 Replies)
Discussion started by: zappedback
3 Replies
5. UNIX for Dummies Questions & Answers
Hi Guys,
total newbie here, Ive read through some of the threads about cron and scripts not working and have still drawn a blank as to why mine isnt working correctly.
I have a script that runs the ausearch with a set of criteria i have setup, the only access i have to the system is via... (5 Replies)
Discussion started by: richie190784
5 Replies
6. Shell Programming and Scripting
Ok, don't ask me why, but all calls to perl must be called by a shell script. Its really not ideal, but its what I have to work with.
Calling it isnt the issue, its passing in the arguments.
I have about 1000 perl scripts to call by a shell script. Right now, I'm executing the shell script... (3 Replies)
Discussion started by: regexnub
3 Replies
7. Shell Programming and Scripting
Hello,
I'm having trouble with formatting some text via the terminal. I can get it perfectly formatted, but when I try and copy paste the text from the output file it loses it's formatting. Very frustrating!
Basically I have 7 files (data data2 data3 data4 data5 data6 data7) containing a... (13 Replies)
Discussion started by: facetoe
13 Replies
8. Homework & Coursework Questions
Hi, I'm a complete novice to Linux and UNIX. I'm having trouble getting a script to execute properly. I did a similar script earlier in the semester with no problems. For whatever reason I can't get this one to work. Any help would be greatly appreciated as I'm completely lost and frustrated at... (5 Replies)
Discussion started by: Lindy70
5 Replies
9. Shell Programming and Scripting
Hi,
I'm newbie in the shell script world and i want to solve some problems I am experiencing.
My main goal is to create a ksh script to use 2 text files as input to execute a local shell script(create user commands in the criar.users.aix file) through a ssh connection in which the list of... (1 Reply)
Discussion started by: joaochambino
1 Replies
10. Shell Programming and Scripting
I'm trying to copy script output and use it in this same script as a variable, and call the variable when script is compiled.
The script is below.
#!/bin/bash
output=$(script)
while read line; do
if ];
then
grep "$line" logfile.txt
# Create text file
echo "From: IT ... (4 Replies)
Discussion started by: SysAdminRialto
4 Replies
LEARN ABOUT DEBIAN
bup-margin
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)