Sponsored Content
Full Discussion: multi-file multi-edit
Top Forums UNIX for Dummies Questions & Answers multi-file multi-edit Post 3246 by mib on Wednesday 27th of June 2001 12:40:50 PM
Old 06-27-2001
Quote:
Originally posted by kielitaide

#!/bin/sh
for file in `find . -name "*.txt"`
do
perl -pi.bak -e '
s/judgments/Truth/g;
s/precepts/Truth/g;
s/laws/Truth/g;
s/testimonies/Truth/g;
s/commandments/Truth/g;
s/statutes/Truth/g;

' $file

done

#!/bin/sh
for file in `find . -name "*.txt"`
do
perl -pi.bak -e '
s/judgments|precepts|laws|testimonies|commandments|statutes/Truth/g;

' $file


Shantih!
 

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Multi booting file systems

Hi all, I'm trying to get Mandrake 9.0, XP & 2K happening on the same machine. I've been reading about osl 2000 (bootmanager) and it says I should convert my Windows (currently ntfs) to fat 32 "if possible". Why? Also, when I connect the linux drive my machine boots straight to Mandrake - no... (2 Replies)
Discussion started by: onestepto
2 Replies

2. UNIX for Dummies Questions & Answers

Multi User Multi Task

Dear Experts Why we always hear that unix operating system is Multi User and Multi task. What does these two means. I have looked at some books and documents but couldn't find aclear explenation. Can we say Windows operating system is also multi user and multi task?? Thanks for your help in... (6 Replies)
Discussion started by: Reza Nazarian
6 Replies

3. Shell Programming and Scripting

multi file editing in vi

Hi all Some yeras ago (1994) I had a utility that bundled up multiple files into a big file with a seperator lines. Automatically loaded this temp file into vi - which allowed you to edit all the files. then when you :wq or ZZ vi it saved all the files bak to their appropriate file names and got... (0 Replies)
Discussion started by: ricl999
0 Replies

4. Shell Programming and Scripting

Multi File processing

Hello, I have 2 csv files: File1: Name,year,organization Jim,2007,Org1 Bob,1999,Org3 Chris,2001,Org2 File2: DocumentName,DocumentTitle,organization,year Test1,Test1,Org1,2007 Test2,Test2,Org2,2008 Test3,Test3,Org3,2009 Using the ksh, I'm reading by line and grabbing the... (2 Replies)
Discussion started by: orahi001
2 Replies

5. Shell Programming and Scripting

Multi-copying a file

Hello there, I am writting a scrip with in shell (#!/bin/sh) and I need to copy 5 times the same file into different names: cp xsec.1.11 xsec.1.12 cp xsec.1.11 xsec.1.13 cp xsec.1.11 xsec.1.14 cp xsec.1.11 xsec.1.15 cp xsec.1.11 xsec.1.16 and I have to do that for several file.... (6 Replies)
Discussion started by: jolecanard
6 Replies

6. Shell Programming and Scripting

Parse Multi-Section Configuration File

Hello all, Sample configuration file: username = root password = admin IpAddress = 192.168.2.90 HttpCommand = /getfile?hello.jpg Username = root2 Password = admin2 Passive = no Host = 192.168.1.100 Path = /uploads Username = root3 Password = adming Passive = no Host =... (10 Replies)
Discussion started by: LAVco
10 Replies

7. Shell Programming and Scripting

Multi-line filtering based on multi-line pattern in a file

I have a file with data records separated by multiple equals signs, as below. ========== RECORD 1 ========== RECORD 2 DATA LINE ========== RECORD 3 ========== RECORD 4 DATA LINE ========== RECORD 5 DATA LINE ========== I need to filter out all data from this file where the... (2 Replies)
Discussion started by: Finja
2 Replies

8. Shell Programming and Scripting

How to substract selective values in multi row, multi column file (using awk or sed?)

Hi, I have a problem where I need to make this input: nameRow1a,text1a,text2a,floatValue1a,FloatValue2a,...,floatValue140a nameRow1b,text1b,text2b,floatValue1b,FloatValue2b,...,floatValue140b look like this output: nameRow1a,text1b,text2a,(floatValue1a - floatValue1b),(floatValue2a -... (4 Replies)
Discussion started by: nricardo
4 Replies

9. Programming

Multi head/multi window hello world

I am trying to write a large X app. I have successfully modified my xorg.conf to setup 4 monitors on an NVIDIA Quatro5200. I am trying to modify a simple hello world application to open a window on three of the four monitors. depending on the changes to loop the window creation section and event... (2 Replies)
Discussion started by: advorak
2 Replies

10. Shell Programming and Scripting

Help with reformat single-line multi-fasta into multi-line multi-fasta

Input File: >Seq1 ASDADAFASFASFADGSDGFSDFSDFSDFSDFSDFSDFSDFSDFSDFSDFSD >Seq2 SDASDAQEQWEQeqAdfaasd >Seq3 ASDSALGHIUDFJANCAGPATHLACJHPAUTYNJKG ...... Desired Output File >Seq1 ASDADAFASF ASFADGSDGF SDFSDFSDFS DFSDFSDFSD FSDFSDFSDF SD >Seq2 (4 Replies)
Discussion started by: patrick87
4 Replies
boolean(3pm)						User Contributed Perl Documentation					      boolean(3pm)

NAME
boolean - Boolean support for Perl SYNOPSIS
use boolean; do &always if true; do &never if false; do &maybe if boolean($value)->isTrue; and: use boolean ':all'; $guess = int(rand(2)) % 2 ? true : false; do &something if isTrue($guess); do &something_else if isFalse($guess); and: use boolean -truth; die unless ref(42 == 42) eq 'boolean'; die unless ("foo" =~ /bar/) eq '0'; DESCRIPTION
Most programming languages have a native "Boolean" data type. Perl does not. Perl has a simple and well known Truth System. The following scalar values are false: $false1 = undef; $false2 = 0; $false3 = 0.0; $false4 = ''; $false5 = '0'; Every other scalar value is true. This module provides basic Boolean support, by defining two special objects: "true" and "false". RATIONALE
When sharing data between programming languages, it is important to support the same group of basic types. In Perlish programming languages, these types include: Hash, Array, String, Number, Null and Boolean. Perl lacks native Boolean support. Data interchange modules like YAML and JSON can now "use boolean" to encode/decode/roundtrip Boolean values. FUNCTIONS
This module defines the following functions: true This function returns a scalar value which will evaluate to true. The value is a singleton object, meaning there is only one "true" value in a Perl process at any time. You can check to see whether the value is the "true" object with the isTrue function described below. false This function returns a scalar value which will evaluate to false. The value is a singleton object, meaning there is only one "false" value in a Perl process at any time. You can check to see whether the value is the "false" object with the isFalse function described below. boolean($scalar) Casts the scalar value to a boolean value. If $scalar is true, it returns "boolean::true", otherwise it returns "boolean::false". isTrue($scalar) Returns "boolean::true" if the scalar passed to it is the "boolean::true" object. Returns "boolean::false" otherwise. isFalse($scalar) Returns "boolean::true" if the scalar passed to it is the "boolean::false" object. Returns "boolean::false" otherwise. isBoolean($scalar) Returns "boolean::true" if the scalar passed to it is the "boolean::true" or "boolean::false" object. Returns "boolean::false" otherwise. METHODS
Since true and false return objects, you can call methods on them. $boolean->isTrue Same as isTrue($boolean). $boolean->isFalse Same as isFalse($boolean). USE OPTIONS
By default this module exports the "true", "false" and "boolean" functions. The module also defines these export tags: :all Exports "true", "false", "boolean", "isTrue", "isFalse", "isBoolean" -truth You can specify the "-truth" option to override truth operators to return "boolean" values. use boolean -truth; print ref("hello" eq "world"), " "; Prints: boolean "-truth" can be used with the other import options. AUTHOR
Ingy doet Net <ingy@cpan.org> COPYRIGHT
Copyright (c) 2007, 2008, 2010, 2011. Ingy doet Net. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.12.4 2011-09-12 boolean(3pm)
All times are GMT -4. The time now is 01:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy