Sponsored Content
Full Discussion: Help with Copy Shell Script
Top Forums UNIX for Dummies Questions & Answers Help with Copy Shell Script Post 302697317 by dixer on Thursday 6th of September 2012 01:43:54 PM
Old 09-06-2012
Help with Copy Shell Script

Hello,

I am currently learning UNIX scripting and have written a simple copy program.

However, upon execution, it returns an error despite debugging correctly.

Can anyone assist in explaining this?

Attached screenshots illustrating a test execution.

Many thanks.
Help with Copy Shell Script-copyscript1png
Help with Copy Shell Script-copyscript2png
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Urgent !!! Shell script to copy files to VSS

Hi all !!! I need this sample script urgently. Please help. Suppose I do an "ls -ltr" in a directory and store the output in a text file (say "a.txt"). What I need to do is to write a shell script which reads file-names from "a.txt" and copies only those files to VSS. Let's say the destination... (1 Reply)
Discussion started by: devalin
1 Replies

2. Shell Programming and Scripting

How to copy and paste line in shell script

Hi I want to grep for a line and copy and paste that line. for Example ---- file abc.txt ---- host=atlx1 sid=atld1 mail=abc@abc.com host=atlx2 sid=atld2 mail=xyz@abc.com host=atlx3 sid=atld3 mail=def@abc.com host=atlx4 sid=atld4 mail=mno@abc.com --- end of file abc.txt ---- Now I... (16 Replies)
Discussion started by: upsrk
16 Replies

3. Shell Programming and Scripting

suggestion on shell script on copy with xargs

Hi, i am trying to copy files except the latest, my script goes here #! /bin/bash # to copy control files to a local DR server # copy latest files of archive #modified on 26-03-2009 # --get today date dt=` date +"%Y_%m_%d"` --get yesterdays date adt=`(date --date='1 day ago'... (1 Reply)
Discussion started by: saha
1 Replies

4. Shell Programming and Scripting

Help with a shell script to modify one line and copy the next 9 to same file

Hi everyone, the problem is quite simple, yet I can't find an easy solution using awk. I need to search for a string in $3, then if I find this string, copy the line,modify $3, and copy the next 9 lines to the same file. My problem is in the copying of the lines... Finding and modifying... (5 Replies)
Discussion started by: Teroc
5 Replies

5. Shell Programming and Scripting

Shell Script - Copy File at intervals

Hi, I want to copy some files from a Folder say, /usr/X at random intervals to another location. Basically, new files will be dumped at random intervals to location /usr/X and I have to copy those new files to some other location (after copying, I cannot delete those files from source... (2 Replies)
Discussion started by: angshuman_ag
2 Replies

6. Shell Programming and Scripting

shell script to search and copy files

Hello Im new to this forums, I would like some help regarding a script that I need in order to copy some files. Heres the scenario: I need to search several files which have a particular code inside, lets say "test" all of them on different directories. I need to copy all of them on a new... (4 Replies)
Discussion started by: c.watson
4 Replies

7. Shell Programming and Scripting

Shell Script, Copy process using find.

Ok, so here is what I am looking for.. Shell script that uses find to look for one days worth of data using the modified date and then copies only those files to a specified directory. I figured I could use grep and the find command to do this. It seems to work just fine from what I can... (4 Replies)
Discussion started by: techjunky
4 Replies

8. Shell Programming and Scripting

Shell script to copy file

Dear all, I have a database with thousands of files with the structure of name is: Filename_hour_year.abc Filename_hour_year_1.abc .............. So what I need is how to write a script that all file with contain the character "_1" will copy to "_2" For example: file name:... (7 Replies)
Discussion started by: hainguyen1402
7 Replies

9. Shell Programming and Scripting

shell script to check permission before copy over

Hi, I am writing some shell script to check the file owner permission whether the write bit is turn on. If it is turn on it will copy the file to the destination else it will just prompt user to change the file and skipping it. However, I am starting getting loss here as I have couple of... (2 Replies)
Discussion started by: wanaka
2 Replies

10. Shell Programming and Scripting

Shell script to copy files from on folder to another

I am trying to copy files with specific date and name to another folder. I am very new to shell scripting so i am finding it hard to do that. see the sample code i have written below. srcdir="/media/ubuntu/CA52057F5205720D/Users/st4r8_000/Desktop/office work/26 nov"... (13 Replies)
Discussion started by: Aqeel Abbas
13 Replies
setjmp(3)						     Library Functions Manual							 setjmp(3)

NAME
setjmp, _setjmp, longjmp, _longjmp - Saves and restores the current execution context LIBRARY
Standard C Library (libc.a, libc.so) System V Library (libsys5.a, libsys5.so) SYNOPSIS
#include <setjmp.h> int setjmp( jmp_buf environment); void longjmp( jmp_buf environment, int value); int _setjmp ( jmp_buf environment); void _longjmp( jmp_buf environment, int value); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: setjmp(), longjmp(): XSH4.2 _setjmp(), _longjmp(): XSH4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies an address for a jmp_buf structure. Specifies the value you want written to the execution context as the return value of the setjmp() or _setjmp() function. If you specify 0 (zero) in this parameter, the execution context contains a value of 1 as the setjmp() or _setjmp() return value. See the RETURN VALUES section for more information. DESCRIPTION
The setjmp() and longjmp() functions are useful when handling errors and interrupts encountered in low-level functions of a program. The setjmp() function saves the current stack context and signal mask in the buffer specified by the environment parameter. You then use the buffer in a later call to the longjmp() function. The longjmp() function restores the stack context and signal mask that were saved by the setjmp() function. After the longjmp() function runs, program execution continues as though the corresponding call to the setjmp() function had just returned the value of the value parameter. The function that called the setjmp() function must not have returned before the completion of the longjmp() function. The _setjmp() and _longjmp() functions operate identically to the setjmp() and longjmp() functions, respectively, except that _setjmp() and _longjmp() manipulate only the stack context. These functions do not restore the signal mask. All accessible objects have values at the time longjmp() is called, except for some objects of automatic storage duration. Objects of automatic storage duration will have indeterminant values if they meet all of the following conditions: They are local to the function con- taining the corresponding setjmp() invocation. They do not have volatile-qualified type. They are changed between the setjmp() and the longjmp() call. Because it bypasses the usual function call and return mechanisms, the longjmp() function executes correctly in contexts of interrupts, signals, and any of their associated functions. However, if the longjmp() function is invoked from a nested signal handler (that is, from a function invoked as a result of a signal raised during the handling of another signal), the behavior is undefined. NOTES
[Tru64 UNIX] For compatibility, the System V versions of the setjmp() and longjmp() functions, which are equivalent to _setjmp() and _longjmp(), respectively, are also supported. To use the System V versions of setjmp() and longjmp(), you must link with the libsys5 library before you link with libc. CAUTION
The results of the longjmp() function are undefined in the following situations: The longjmp() function is called with an environment parameter that was not previously set by the setjmp() function. The function that made the corresponding call to the setjmp() function has already returned. If the longjmp() function detects one of these conditions, it calls the longjmperror() function. If longjmperror() returns, the program is aborted. The default version of longjmperror() displays an error message to standard error and returns. If you want your program to exit more gracefully, you can write your own version of the longjmperror() program. RETURN VALUES
After the longjmp() function is finished executing, program execution continues as though the corresponding call of the setjmp() function just returned. In other words, the execution context saved by the corresponding setjmp() function is in place and execution continues at the statement immediately following the call to the setjmp() function. Part of that execution context is the return value from the setjmp() function. When the setjmp() function actually returns (before the call to the longjmp() function), that return value is 0 (zero). When the longjmp() function returns, the execution context contains a non-zero value as the return value from the setjmp() function. The value you specify in the value parameter to the longjmp() function is written to the execution context as the return value for the setjmp() function. You cannot cause the execution context to contain a 0 (zero) value for the setjmp() return value. If you specify 0 in the value parameter, the execution context contains a 1 as the setjmp() return value. RELATED INFORMATION
Routines: siglongjmp(3), sigsetjmp(3) Standards: standards(5) delim off setjmp(3)
All times are GMT -4. The time now is 06:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy