06-24-2008
Generating a generic incremental code
Hi Gurus,
I have several Solaris systems (say system a, system b,system c) which will connect to a windows system (system Z) using SFTP session.
I have a 'txt' file on System Z , which has a simple numeric value on it(say 1) , If I have to increment this number with 1 (1+1 =2) irrespective of the source system . how do i do this.
Ex: I connect from system a to system Z , read the txt file get the number 1 , increment this number to 2 (1+1=2) . When I connect from system b or system c the number in txt file to be read should be 2, this number is once again incremented to 3 (2+1=3).
The Challenge: I'm unable to increment the file using the sftp session.
Please shed some light....
Thanks
Ram.
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
#!/bin/sh
copy()
{
source=`stat -c %s $1`
dest=0
cd $2
while ;do
cp $1 $2 &
pct=`((100 * $dest) / $source )`
dest=`dest+1`
echo -en ".$pct%\b\b\b"
sleep 1
done
}
echo "starting now"
copy /file1 /tmp (3 Replies)
Discussion started by: wrapster
3 Replies
2. UNIX for Dummies Questions & Answers
Hi All..
i am trying to write a script which will give the incremental tar backup of all files with latest timestam.
i tried with find -mmin -2
but if it takes half on hour or something to creat the tar itself, then no meaning in using the above command.
so please help me to find the... (2 Replies)
Discussion started by: Usha Shastri
2 Replies
3. UNIX for Dummies Questions & Answers
let says, i have this number as 000002080, i want to add 1 to make it 000002081, and then i want to add 1 to 000002082, add 1 to 000002083, 84.
i=000002080
TOT=$(echo "scale=9; $i + 1" | bc)
echo $TOT
it shows 2081, i want to retain 000002081, 000002082, 000002082, 000002084. (2 Replies)
Discussion started by: tjmannonline
2 Replies
4. Windows & DOS: Issues & Discussions
I have a folder /root/test in a centos 5.3 system. I want to take an incremental backup of the contents of the folder in the C:\Downloads folder of a windows system present in the same lan as the linux system. What are the ways of executing this plan? Kindly help (0 Replies)
Discussion started by: proactiveaditya
0 Replies
5. Shell Programming and Scripting
Hi. Can someone tell me if the following script that i have made is a script for INCREMENTAL BACKUP or FULL BACKUP. My teacher told me that is doing an FULL BACKUP.
• find /etc /var /home -newer /backups/.backup_reference > /backups/.files_to_archive
• touch /backups/.backup_reference
• tar... (1 Reply)
Discussion started by: bender-alex
1 Replies
6. Shell Programming and Scripting
Hi everybody
I'm working on a list of registers(flip-flops to be exact), now i need to extract some value from this list and use them as arguments to pass them to some assembly code
for example i have:
118 chain79 MASTER (FF-LE) FFFF 1975829 /TCK F FD1TQHVTT1 ... (1 Reply)
Discussion started by: Behrouzx77
1 Replies
7. Shell Programming and Scripting
Hi All,
I am looking for a generic code which can search for the existing delimiter(what ever it may be) in a file and convert it to Pipeline. The file may have Pipeline delimiter already in that case just leave it. Please find below some sample records.
Sample records1:
... (2 Replies)
Discussion started by: Arun Mishra
2 Replies
8. Shell Programming and Scripting
Would it be possible for a script to duplicate a file and incrementally number it?
File in: XXX_007_0580_xxxx_v0016.aep
File out: XXX_007_0580_xxxx_v0017.aep
If someone knows of a way I'd love to see it.
Thanks! (7 Replies)
Discussion started by: scribling
7 Replies
BRK(2) Linux Programmer's Manual BRK(2)
NAME
brk, sbrk - change data segment size
SYNOPSIS
#include <unistd.h>
int brk(void *end_data_segment);
void *sbrk(ptrdiff_t increment);
DESCRIPTION
brk sets the end of the data segment to the value specified by end_data_segment, when that value is reasonable, the system does have enough
memory and the process does not exceed its max data size (see setrlimit(2)).
sbrk increments the program's data space by increment bytes. sbrk isn't a system call, it is just a C library wrapper. Calling sbrk with
an increment of 0 can be used to find the current location of the program break.
RETURN VALUE
On success, brk returns zero, and sbrk returns a pointer to the start of the new area. On error, -1 is returned, and errno is set to
ENOMEM.
CONFORMING TO
BSD 4.3
brk and sbrk are not defined in the C Standard and are deliberately excluded from the POSIX.1 standard (see paragraphs B.1.1.1.3 and
B.8.3.3).
SEE ALSO
execve(2), getrlimit(2), malloc(3)
Linux 0.99.11 1993-07-21 BRK(2)