Sponsored Content
Full Discussion: -gt option in UNIX
Top Forums Shell Programming and Scripting -gt option in UNIX Post 303029810 by RudiC on Friday 1st of February 2019 05:05:34 AM
Old 02-01-2019
I'm afraid that entire script doesn't make too much sense. You may want to run it with the -x(xtrace=) option set to see how and where it fails.

First logical error:COUNT=$(echo "${BACKUPLIST}" | wc -l). Guessing you want that file's line count, try
Code:
COUNT=$(<"${BACKUPLIST}"  wc -l)

Otherwise it will just count the file name string, most probably resulting in 1.

Same here START=$(echo "${BACKUPLIST}" | sed -n 1p) and here END=$(echo "${BACKUPLIST}" | sed -n $((1+COUNT-RESTOREPOINTS))p)
If what you're after is to repeat the restores from first to $RESTOREPOINTSth, try to replace by
Code:
START=$(sed -n 1p  "${BACKUPLIST}");
 END=$(sed -n "$((1+COUNT-RESTOREPOINTS))p" "${BACKUPLIST}")

The terminating fi is missing, but there might be code lines following.
Did you consider the head and tail *nix text tools?

Last edited by RudiC; 02-01-2019 at 06:10 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX chauthtok(): illegal module option

Hi all, I just implemented PAM on my Solris 8/9 boxes and one of the entries I have got in the /etc/pam.conf is as followed, other password required pam_unix.so nullok remember=7 md5 shadow use_authtok However, once I set this and the following meesages appears in /var/adm/messages... (1 Reply)
Discussion started by: stancwong
1 Replies

2. Shell Programming and Scripting

option followed by : taking next option if argument missing with getopts

Hi all, I am parsing command line options using getopts. The problem is that mandatory argument options following ":" is taking next option as argument if it is not followed by any argument. Below is the script: while getopts :hd:t:s:l:p:f: opt do case "$opt" in -h|-\?)... (2 Replies)
Discussion started by: gurukottur
2 Replies

3. Shell Programming and Scripting

what is -u option in while loop in unix

Hi all, What does -u option in while loop indicates in unix? ex: while read -u field (1 Reply)
Discussion started by: krishna_gnv
1 Replies

4. Shell Programming and Scripting

Unix Shell Script: With Menu Option

I am attempting to create a shell script with the following capaciblities: 1. Listed options to choice from 2. Use to perform awk statements 3. Print a report with the awk results My questions are 1. How do I select more than one file for option #5 and #6 2. How to I create an... (11 Replies)
Discussion started by: jroberson
11 Replies

5. Shell Programming and Scripting

Unix mail with bcc option

Hello Everyone, I'm using UNIX 5.3, I'm using command line mailx or mail command to send emails to multiple email addresses and i need to include bcc (background corbon copy). Some Manuals says i can use -b flag to send to bcc but my unix does not recognize the flag "-b". And some manuals says... (1 Reply)
Discussion started by: aravindbachu
1 Replies

6. Shell Programming and Scripting

unix find command without mmin option

I need to check if a file has been modified within the last x hours. My find command does not have the mmin option -- only the mtime option which is in 24 hour perriods (1 Reply)
Discussion started by: Bill Ma
1 Replies

7. Shell Programming and Scripting

recently introduced to the newer option for find...does an older option exist?

To find all the files in your home directory that have been edited in some way since the last tar file, use this command: find . -newer backup.tar.gz Is anyone familiar with an older solution? looking to identify files older then 15mins across several directories. thanks, manny (2 Replies)
Discussion started by: mr_manny
2 Replies

8. Shell Programming and Scripting

Request for file read option in Unix shell scripting

Hi Friends, I would like to read all the record from one txt file to other file txt For example I have two txt file a.txt and b.txt. I need to read a.txt record by record and I need add the system date @ end of each record before moving it to b.txt. Could you please share the coding for... (4 Replies)
Discussion started by: vinoth124
4 Replies

9. Shell Programming and Scripting

Unix Find with exec option.

All, I am using following find command to see all the files with specified pattern : find /exp/source -exec grep -li "SIT_MARKET" {} \; say , the /exp/source has n number of subdirectories and each subdirectory has its own directory tree. If this is the case I will get a result... (9 Replies)
Discussion started by: kanu_kanu
9 Replies

10. Solaris

Unrecognized option: sparc-sun-Solaris2.10/bin/as: unrecognized option `-m32'

Hi, I installed some packages required by an app built with python. But when I try python setup.py install, I get the following error: /opt/csw/lib/gcc/sparc-sun-solaris2.10/5.2.0/../../../../sparc-sun-solaris2.10/bin/as: unrecognized option `-m32' Could anyone tell me what's wrong... (4 Replies)
Discussion started by: Kimkun
4 Replies
BARRIER(3PVM)							  PVM Version 3.4						     BARRIER(3PVM)

NAME
pvm_barrier - Blocks the calling process until all processes in a group have called it. SYNOPSIS
C int info = pvm_barrier( char *group, int count ) Fortran call pvmfbarrier( group, count, info ) PARAMETERS
group Character string group name. The group must exist and the calling process must be a member of the group. count Integer specifying the number of group members that must call pvm_barrier before they are all released. Though not required, count is expected to be the total number of members of the specified group. info Integer status code returned by the routine. Values less than zero indicate an error. DESCRIPTION
The routine pvm_barrier blocks the calling process until count members of the group have called pvm_barrier. The count argument is required because processes could be joining the given group after other processes have called pvm_barrier. Thus PVM doesn't know how many group members to wait for at any given instant. Although count can be set less, it is typically the total number of members of the group. So the logical function of the pvm_barrier call is to provide a group synchronization. During any given barrier call all participating group members must call barrier with the same count value. Once a given barrier has been successfully passed, pvm_barrier can be called again by the same group using the same group name. If pvm_barrier is successful, info will be 0. If some error occurs then info will be < 0. EXAMPLES
C: inum = pvm_joingroup( "worker" ); . . info = pvm_barrier( "worker", 5 ); Fortran: CALL PVMFJOINGROUP( "shakers", INUM ) COUNT = 10 CALL PVMFBARRIER( "shakers", COUNT, INFO ) ERRORS
These error conditions can be returned by pvm_barrier PvmSysErr pvmd was not started or has crashed. PvmBadParam giving a count < 1. PvmNoGroup giving a non-existent group name. PvmNotInGroup calling process is not in specified group. SEE ALSO
pvm_joingroup(3PVM) 30 August, 1993 BARRIER(3PVM)
All times are GMT -4. The time now is 07:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy