Sponsored Content
Top Forums Shell Programming and Scripting Need Help: Delete a file by Shell Script Post 77559 by r3edi on Monday 11th of July 2005 04:35:56 AM
Old 07-11-2005
What if the file that needs to be deleted is in the same server as the script? I still can't use rm ?

It's actually an EDI Gentran UNIX server.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Shell Script --- Delete ORA error from data file

Hi All, I have to make the following changes in shell script: When the data file is being created, an “ORA” error occurs in it. I have to remove this ORA error from data file and put it in log file. I am “ -n grip command” to find the ORA error and get the line number, How do I delete it... (1 Reply)
Discussion started by: sk005
1 Replies

2. Shell Programming and Scripting

shell script to edit file and delete entry

Can anyone provide me a shell script to edit a xml file and delete one entry. To do manually i can edit(vi editor) the file and 'dd' will delete the file.But I wiluld to know if I can do with a script. Thanks in advance Tannu (6 Replies)
Discussion started by: tannu
6 Replies

3. Shell Programming and Scripting

shell script for delete old files

i want to delete all the files in my directory except the latest one. i need to do this from shell script. say i have a.txt - latest file b.txt, c.txt.. it should delete all the files except a.txt? (4 Replies)
Discussion started by: krishnarao
4 Replies

4. Shell Programming and Scripting

Delete content of file 1 in file 2 with shell script

OK, best is I explain what the operating enviroment is. Linux, but Motomagx. It is a Linux operated mobile phone, Motorola V8. I am writting a shell script, but got stuck. I have to delete the complete content of file 1 in file 2. I have attached the 2 files. You can see that the content of... (2 Replies)
Discussion started by: rasputin007
2 Replies

5. Shell Programming and Scripting

Need Shell Script to delete lines in a file

Hi All, I have a file with 3 columns (Bank Name, Account Number and Amount). My requirement, I need to delete lines using Unix Shell script: 1. Which are having Alphanumeric characters in Account Number (eg. Line3). 2. Which are having 0.00 in amount. (eg. Line4) 3. And also I need to... (4 Replies)
Discussion started by: phani333
4 Replies

6. Shell Programming and Scripting

Shell script for searching a record,copy to a file and then delete it

Hi, I have a requirement in hand: I have a file with millions of records say file 1.I have another file, say file 2 which has 2000 records in it. The requirement is to read file2 , and remove the read record from file 1 and move i to a seperate file, file 3. For eg: Read file 2, get the... (5 Replies)
Discussion started by: kumara2010
5 Replies

7. Shell Programming and Scripting

perl script to check if empty files are created and delete them and run a shell script

I have a local linux machine in which the files are dumped by a remote ubuntu server. If the process in remote server has any problem then empty files are created in local machine. Is there any way using perl script to check if the empty files are being created and delete them and then run a shell... (2 Replies)
Discussion started by: hussa1n
2 Replies

8. Shell Programming and Scripting

delete only particular file in directory shell script

Hi, what function do we use to delete only particular file that we want in directory shell script for example I want only to delete test.txt in directory how to do it ? in sh Thank (1 Reply)
Discussion started by: guidely
1 Replies

9. Red Hat

Need Script to ZIP/SAVE & then DELETE Log file & DELETE ZIPS older than 12 months

ENVIROMENT Linux: Fedora Core release 1 (Yarrow) iPlanet: iPlanet-WebServer-Enterprise/6.0SP1 Log Path: /usr/iplanet/servers/https-company/logs I have iPlanet log rotation enabled rotating files on a daily basis. The rotated logs are NOT compressed & are taking up too much space. I... (7 Replies)
Discussion started by: zachs
7 Replies

10. Shell Programming and Scripting

Shell script to check a file and delete old files

Hello, I needed help with a shell script where in it checks if a file exists under a directory and also checks the age of the file and delete it if it is older than 3 weeks. thanks (10 Replies)
Discussion started by: hasn318
10 Replies
Business::EDI(3pm)					User Contributed Perl Documentation					Business::EDI(3pm)

NAME
Business::EDI - Top level class for generating U.N. EDI interchange objects and subobjects. SYNOPSIS
use Business::EDI; my $edi = Business::EDI-new('d09b'); # set the EDI spec version my $rtc = $edi->codelist('ResponseTypeCode', $json) or die "Unrecognized code!"; printf "EDI response type: %s - %s (%s) ", $rtc->code, $rtc->label, $rtc->value; my $msg = Business::EDI::Message->new($ordrsp) or die "Failed Message constructor"; foreach ($msg->xpath('line_detail/all_LIN') { ($_->part(7143) || '') eq 'EN' or next; print $_->part(7140)->value, " "; # print all the 13-digit (EN) ISBNs } DESCRIPTION
The focus of functionality is to provide object based access to EDI messages and subelements. At present, the EDI input processed by Business::EDI objects is JSON from the edi4r ruby library, and there is no EDI output beyond the perl objects themselves. NAMESPACE
When you "use Business::EDI;" the following package namespaces are also loaded: Business::EDI::Segment_group Business::EDI::Message That's why the example message constructor in SYNOPSIS would succeed without having done "use Business::EDI::Message;" EDI Structure Everything depends on the spec. That means you have to have declared a spec version before you can create or parse a given chunk of data. The exception is a whole EDI message, because each message declares its spec version internally. EDI has a hierachical specification defining data. From top to bottom, it includes: Communication - containing one or more messages (not yet modeled here) Message - containing segment groups and segments Segment Group - containing segments Segment - containing composites, codelists and data elements Composite - containing multiple codelists and/or data elements Codelist - enumerated value from a spec-defined set Data Element - unenumerated value This module handles messages and everything below, but not (yet) communications. CLASS FUNCTIONS
Much more documentation needed here... new() Constructor OBJECT METHODS (General) value() Get/set accessor for the value of the field. code() The string code designating this node's type. The code is what is what the spec uses to refer to the object's definition. For example, a composite "C504", segment "RFF", data element "7140", etc. Don't be confused when dealing with CodeList objects. Calling code() gets you the 4-character code of the CodeList field, NOT what that CodeList is currently set to. For that use value(). desc() English description of the element. METHODS (for Traversal) part_keys() This method returns strings that can be fed to part() like: foreach ($x->part_keys) { something($x->part($_)) } This is similar to doing: foreach (keys %x) { something($x{$_}) } In this way an object can be exhaustively, recursively parsed without further knowledge of it. part($key) Returns subelement(s) of the object. The key can reference any subobject allowed by the spec. If the subobject is repeatable, then prepending "all_" to the key will return an array of all such subobjects. This is the safest and most comprehensive approach. Using part($key) without "all_" to retrieve when there is only one $key subobject will succeed. Using part($key) without "all_" to retrieve when there are multiple $key subobjects will FAIL. Since that difference is only dependent on data, you should always use "all_" when dealing with a repeatable field (or xpath, see below). Examples: my $qty = $detail->part('QTY'); # FAILURE PRONE! my @qtys = $detail->part('all_QTY'); # OK! xpath($path) $path can traverse multiple depths in representation via one call. For example: $message->xpath('all_SG26/all_QTY/6063') is like this function foo(): sub foo { my @x; for my $sg ($message->part->('all_SG26') { for ($sg->part('all_QTY') { push @x, $->part('6063'); } } return @x; } The xpath version is much nicer! However this is nowhere near as fully featured as W3C xpath for XML. This is more like a multple-depth part(). Examples: my @obj_1154 = $message->xpath('line_detail/SG31/RFF/C506/1154'); xpath_value($path) Returns value(s) instead of object(s). Examples: 'ORDRSP' eq $ordrsp->xpath_value('UNH/S009/0065') or die "Wrong Message Type!"; WARNINGS
This code is experimental. EDI is a big spec with many revisions. At the lower levels, all data elements, codelists, composites and segments from the most recent spec (D09B) are present. SEE ALSO
Business::EDI::Spec edi4r - http://edi4r.rubyforge.org AUTHOR
Joe Atzberger perl v5.12.4 2010-09-08 Business::EDI(3pm)
All times are GMT -4. The time now is 11:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy