Sponsored Content
Top Forums Shell Programming and Scripting Script to maintain file versions Post 302582664 by vskr72 on Friday 16th of December 2011 07:09:14 PM
Old 12-16-2011
Script to maintain file versions

I am developing a script to maintain 'n' number of versions of a file. The script will take a filename as a parameter and the number of versions to maintain. This basically does something like a FIFO. Here is what I developed. But something is not right. I have attached the script. Can u pls help here?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Maintain full path of a script in a var when sourcing it from a different script

Hi All, I've searched through the forum for a solution to this problem, but I haven't found anything. I have 2 script files that are in different directories. My first script, let's call it "/one/two/a.sh" looks like this: #!/bin/sh IN_DIR=`dirname $0` CUR_DIR=`pwd` cd $IN_DIR... (4 Replies)
Discussion started by: mrbluegreen
4 Replies

2. UNIX for Dummies Questions & Answers

maintain database script...

Hi there. i'm new user at here I need help for this. I need to write a script that maintains a database of cryptographic checksums. In other words, I need this script to check the files checksum whether the files has been modified or not. But i got no idea where to start. Hope anyone here can... (8 Replies)
Discussion started by: hihihehe
8 Replies

3. UNIX for Dummies Questions & Answers

sed a file and maintain date stamp and permissions

I need to alter a file. I'm using sed then passing output to temp file then using touch -r to maintain the date but the permissions do not get preserved How can I sed a file and maintain date and permissions currently it's preserving the date but the permissions revert back to the... (3 Replies)
Discussion started by: andyatit
3 Replies

4. UNIX for Dummies Questions & Answers

Script that will Delete and Maintain Files

Hi guys, Good day to all and Happy New Year!!! Cheers!!! I hope anyone could help/suggest me on hot to create a script that will monitor the directory where files are being dumped. I have a script in CRON that runs everyday and collect for logs with a filename of Output_$(date... (3 Replies)
Discussion started by: rymnd_12345
3 Replies

5. Homework & Coursework Questions

Maintain health of passwd file

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: Hello guys I am about to write a script that is based on "The Linux Administration Handbook" The exercise is... (6 Replies)
Discussion started by: Learn4Life
6 Replies

6. Shell Programming and Scripting

Maintain health of passwd file

Hello guys I am about to write a script that is based on "The Linux Administration Handbook" The exercise is as follows: Write a shell script to help monitor the health of the /etc/passwd file. Find entries that have UID0 Find entries that have no password (needs /etc/shadow) Find any... (4 Replies)
Discussion started by: Learn4Life
4 Replies

7. Shell Programming and Scripting

Needed script to generate versions for a file and maintian them in a folder

need a shell script for the following requirement how to generate 5 versions of a file in a folder after generating them in a folder i want to maintian the past 2 versions of the file in the folder and i have to delete the the remaining. for example if i ran the script today and tommorow... (3 Replies)
Discussion started by: hemanthsaikumar
3 Replies

8. Shell Programming and Scripting

Help with korn shell script to get the latest file versions in a directory

I want to write a korn shell script to get the latest three versions for a file in the directory having lot of files with various versions (files with prefix as same but time stamp as suffix) and compress it and at the same time have to remove the remaining versions of the file (other than latest... (4 Replies)
Discussion started by: maheshbabu
4 Replies

9. Shell Programming and Scripting

Script FTP maintain error handling

Hi, I have ftp script like below How to insert an error handling, If the transfer failed then send mail to me. Actually, I just need the script to send an email if the FTP failed. How to put the email script within FTP script? Thank You Edy (5 Replies)
Discussion started by: edydsuranta
5 Replies

10. UNIX for Advanced & Expert Users

How to maintain a personal password file 'safely'?

Hi all, As time progresses, the number of servers that I have to login to has grown to the hundreds. Some of the servers has NIS so I can use one single password for this group of servers. The hard part comes to when you have 20+ other servers that now require different passwords and... (4 Replies)
Discussion started by: newbie_01
4 Replies
hostalias(3)						     Library Functions Manual						      hostalias(3)

NAME
hostalias - Searches for host aliases SYNOPSIS
#include <sys/types.h> #include <netinet/in.h> #include <arpa/nameser.h> #include <resolv.h> char *hostalias( char *name); The following function is supported in order to maintain backward compatibility with previous versions of the operating system. int hostalias_r( char *name, char *buf, int len); PARAMETERS
Points to the name of the host to retrieve aliases for. Specifies the buffer for the host alias. Specifies the length of buf. DESCRIPTION
The hostalias() function searches for the alias associated with the name. The HOSTALIASES environment variable defines the name of a file in which aliases are kept, in the form: host alias NOTES
The hostalias_r() function is the reentrant version of the hostalias() function. It is supported in order to maintain backward compatibil- ity with previous versions of the operating system. When successful, hostalias_r() provides the alias name(s) in the buffer pointed at by buf, and returns a value of 0 (zero). (This buffer should be at least MAXDNAME characters.) Otherwise, it returns a value of -1 and may set errno. RETURN VALUES
Upon successful completion, the hostalias() function returns the host alias. Otherwise, a null pointer is returned. ERRORS
If the following condition occurs, the hostalias_r() function sets errno to the corresponding value. Host alias could not be found. The buf parameter is invalid or too small. RELATED INFORMATION
Functions: res_mkquery(3), getenv(3). delim off hostalias(3)
All times are GMT -4. The time now is 07:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy