Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Problems with script that unzips multiple zipped tar files then untars the same files in C shell Post 303045622 by odensun on Saturday 4th of April 2020 05:07:45 AM
Old 04-04-2020
I finally got it working. Thank you for all the help. I appreciate it.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Tar multiple files

Hi All, There 2 files in the folder /temp/tst/ 1.txt 2.txt When I run the command find /temp/tst \( -name "*.txt" \) -exec tar cf /temp/123.tar {} \; it creates the tar file 123.tar with only one file in it and that is 2.txt.But if I use the command find /temp/tst \( -name "*.txt"... (1 Reply)
Discussion started by: rony_daniel
1 Replies

2. Shell Programming and Scripting

bash - batch script for extracting one file from multiple tar files

so i have hundreds of files named history.20071112.tar (history.YYYYMMDD.tar) and im looking to extract one file out of each archive called status_YYYYMMDDHH:MM.lis here is what i have so far: for FILE in `cat dirlist` do tar xvf $FILE ./status_* done dirlist is a text... (4 Replies)
Discussion started by: kuliksco
4 Replies

3. UNIX for Advanced & Expert Users

How to create a Tar of multiple Files in Unix and FTP the tar to Windows.

Hi, On my Unix Server in my directory, I have 70 files distributed in the following directories (which have several other files too). These files include C Source Files, Shell Script Source Files, Binary Files, Object Files. a) /usr/users/oracle/bin b) /usr/users/oracle... (1 Reply)
Discussion started by: marconi
1 Replies

4. Shell Programming and Scripting

shell script to join multiple files

I am a new to Linux and try to write a script to join three multiple files. For example, there are three files file1 # comment a Kevin b Vin c Sam file 2 # comment a 10 b 20 c 40 file 3 # comment a blue b yellow (7 Replies)
Discussion started by: bonosungho
7 Replies

5. Shell Programming and Scripting

To write a shell script which groups files with certain pattern, create a tar and zip

Hi Guru's, I have to write a shell script which groups file names based upon the certain matching string pattern, then creates the Tar file for that particular group of files and then zips the Tar file created for the respective group of files. For example, In the given directory these files... (3 Replies)
Discussion started by: rahu_sg
3 Replies

6. Shell Programming and Scripting

How to Read Multiple files in a Shell Script

Hi, Can any one tell me if i can read two files in a shell script... My actual requirement is to read the 1st text file and parse it to get the file code and use this file code to retrieve data from database and print the fetched data in the 2nd text file (I have parsed it and printed the... (2 Replies)
Discussion started by: funonnet
2 Replies

7. Shell Programming and Scripting

Need shell script for ftpying multiple files

Hi All, I am a beginner for shell programming. I have a requirement to ftp multiple files. Here are the details. I have around thiry files in one directory, I want a shell script which selects 5 files at a time and does ftp them to another host . After the transfer for first files is... (0 Replies)
Discussion started by: srikanthn
0 Replies

8. Shell Programming and Scripting

shell script to ftp multiple files

Hi, i use the below script to send a single file to remote server from linux. ftp -nvi <<!EOF open $Host_name user $USER_ID $PWD binary mput $file_name quit !EOF (where i... (2 Replies)
Discussion started by: pradebban
2 Replies

9. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

10. Shell Programming and Scripting

Help getting a UNIX shell script to look at multiple files.

Hey everyone! I made a shell script that would go through a file and replace any phrase or letter with another phrase or letter. Helps update variable names or values. The following code is this: #!/bin/sh Word1="$1" Replace1="$2" File1="$3" arg=$( echo "$Word1" | sed 's:\:\\&:g' )... (3 Replies)
Discussion started by: rebmonk
3 Replies
try(3tcllib)                                       Forward compatibility implementation of [try]                                      try(3tcllib)

__________________________________________________________________________________________________________________________________________________

NAME
try - try - Trap and process errors and exceptions SYNOPSIS
package require Tcl 8.5 package require try ?1? ::try body ?handler...? ?finally script? _________________________________________________________________ DESCRIPTION
This package provides a forward-compatibility implementation of Tcl 8.6's try/finally command (TIP 329), for Tcl 8.5. The code was directly pulled from Tcl 8.6 revision ?, when try/finally was implemented as Tcl procedure instead of in C. ::try body ?handler...? ?finally script? This command executes the script body and, depending on what the outcome of that script is (normal exit, error, or some other excep- tional result), runs a handler script to deal with the case. Once that has all happened, if the finally clause is present, the script it includes will be run and the result of the handler (or the body if no handler matched) is allowed to continue to propa- gate. Note that the finally clause is processed even if an error occurs and irrespective of which, if any, handler is used. The handler clauses are each expressed as several words, and must have one of the following forms: on code variableList script This clause matches if the evaluation of body completed with the exception code code. The code may be expressed as an integer or one of the following literal words: ok, error, return, break, or continue. Those literals correspond to the integers 0 through 4 respectively. trap pattern variableList script This clause matches if the evaluation of body resulted in an error and the prefix of the -errorcode from the interpreter's status dictionary is equal to the pattern. The number of prefix words taken from the -errorcode is equal to the list-length of pattern, and inter-word spaces are normalized in both the -errorcode and pattern before comparison. The variableList word in each handler is always interpreted as a list of variable names. If the first word of the list is present and non-empty, it names a variable into which the result of the evaluation of body (from the main try) will be placed; this will contain the human-readable form of any errors. If the second word of the list is present and non-empty, it names a variable into which the options dictionary of the interpreter at the moment of completion of execution of body will be placed. The script word of each handler is also always interpreted the same: as a Tcl script to evaluate if the clause is matched. If script is a literal - and the handler is not the last one, the script of the following handler is invoked instead (just like with the switch command). Note that handler clauses are matched against in order, and that the first matching one is always selected. At most one han- dler clause will selected. As a consequence, an on error will mask any subsequent trap in the try. Also note that on error is equivalent to trap {}. If an exception (i.e. any non-ok result) occurs during the evaluation of either the handler or the finally clause, the origi- nal exception's status dictionary will be added to the new exception's status dictionary under the -during key. EXAMPLES
Ensure that a file is closed no matter what: set f [open /some/file/name a] try { puts $f "some message" # ... } finally { close $f } Handle different reasons for a file to not be openable for reading: try { set f [open /some/file/name] } trap {POSIX EISDIR} {} { puts "failed to open /some/file/name: it's a directory" } trap {POSIX ENOENT} {} { puts "failed to open /some/file/name: it doesn't exist" } BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category try of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
catch(3tcl), error(3tcl), return(3tcl), throw(3tcl) KEYWORDS
cleanup, error, exception, final, resource management CATEGORY
Utility COPYRIGHT
Copyright (c) 2008 Donal K. Fellows, BSD licensed try 1 try(3tcllib)
All times are GMT -4. The time now is 02:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy