Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Perl Substition with multiple conditions Post 302240363 by EDALBNUG on Thursday 25th of September 2008 02:17:50 PM
Old 09-25-2008
PHP Perl Substition with multiple conditions

I have a text file that contains lines similar to the following:

-----------------------------------------------------------
fall for setup

CSHRC0 'gnd';
CSHR0 'gnd';

rise for setup

rise for hold

CSHRC0 'gnd';
CSHR0 'gnd';

fall for hold
------------------------------------------------------------

I am trying to replace the gnd in between fall for setup and rise for setup with 0.75*vdd.

I tried the following:
Code:
perl -e 's/gnd/0\.75\*vdd/ if m/CSHRC0/ && /fall\ for\ setup/ .. /rise\ for\ setup/' -pi file
perl -e 's/gnd/0\.75\*vdd/ if m/CSHR0/ && /fall\ for\ setup/ .. /rise\ for\ setup/' -pi file

But these don't seem to work at all. I believe the problem is with how I am using the && operator to combine both conditions, since if I use any of those two conditions separately they would work. How can I apply multiple if conditions to the same substitution?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

multiple conditions in if/then

Hello, I am having trouble with the syntax with a conditional statement in a BASH script involving multiple conditions. Any suggestions would be greatly appreciated! if ; then array=("${array}" "$dnNum" ) fi i receive this error: ./testscript: ' (4 Replies)
Discussion started by: grandtheftander
4 Replies

2. Shell Programming and Scripting

multiple if conditions

Guys, Im trying to have a script that evaluates multiple conditions : test.sh: if then echo "host $1" else if then echo "host $1" else echo $1 not valid exit 1 fi when I do ./test.sh brazil1 I get: (4 Replies)
Discussion started by: bashshadow1979
4 Replies

3. Shell Programming and Scripting

If statement with multiple conditions

I have a script that runs on multiple servers. What I want to do is have the script do the following: if $(hostname) is equal to server or server2 then TO_DIR=go else TO_DIR=stop fi I have tried: if if ] Server is hpux. any ideas? (1 Reply)
Discussion started by: cpolikowsky
1 Replies

4. Shell Programming and Scripting

Help regarding multiple conditions

Hi All, I am new to shell scripting. Can any one say what is wrong in this if statement, that uses multiple conditions if then *************** else if ( -z $pcs && "$night_time_calc" > "$night_time" ) then ******************************** ... (4 Replies)
Discussion started by: ssenthilkumar
4 Replies

5. UNIX for Dummies Questions & Answers

Nested if with multiple conditions

Deal Experts I am working on a script to find a date which is 7 days older and follwoing is my approach #!/bin/sh Yr=`date +"%Y"` Mn=`date +"%m"` Md=28 Da=`date +"%d"` echo $Yr echo $Mn echo $Da var1=$Yr$Mn$Da echo "before" $var1 if expr $Da > 7 then Da=`expr $Da - 7`... (3 Replies)
Discussion started by: sweetnsourabh
3 Replies

6. Shell Programming and Scripting

Multiple Conditions Perl if Statement

Hello, I'm trying to put together a script that involves pulling data from a config file. I'm attempting to write an if statement to validate one of the pieces of data from the config file, but I think I'm fat fingering it somehow. $config{VALUE} is being pulled from a config file but can only... (4 Replies)
Discussion started by: Picch
4 Replies

7. UNIX for Dummies Questions & Answers

If + multiple conditions

Hello Unix-Forums! It has been a long time since my last post, but finally I've got a new question: I know in case you can use multiple patterns by case $var in a|b|c|ab) and so on. But how would I place an OR between if ] then ... if ] then ... I want to execute the "..." if... (3 Replies)
Discussion started by: intelinside
3 Replies

8. Shell Programming and Scripting

Using sed and if multiple conditions

Hi I've been trying to get this to work but so far no luck. #!/usr/bin/ksh unset EXP APP=$1 EXP=`sed -n "/${APP}/p" tIclrpt.out |awk '{print $7}'|sed '/^$/d'` EXT=`sed -n "/${i}/p" ${SESLOG} |awk '{print $4}'|grep "${i}"` EXEM=/path/to/fail ACTI=/path/to/success if || then... (10 Replies)
Discussion started by: techy1
10 Replies

9. Shell Programming and Scripting

Multiple conditions in IF

Fellas, Am new to unix os/ and here the situation , I am trying to write multiple condition statement inside if but it throws me a error here is my piece of code , if ] && ] && ] then commands fi error : line 15 : ` can someone please advise me how to fix it Please use... (7 Replies)
Discussion started by: xeccc5z
7 Replies

10. UNIX for Beginners Questions & Answers

Multiple If conditions

I am analyzing one of the scripts written by another person.script is having multiple if conditions and everything are nested.The code is not formatted properly.Is there any way to identify in Unix to identify begin and end of a particular if block? (6 Replies)
Discussion started by: vamsi.valiveti
6 Replies
DateTime::Locale::rw_RW(3)				User Contributed Perl Documentation				DateTime::Locale::rw_RW(3)

NAME
DateTime::Locale::rw_RW SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'rw_RW' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Kinyarwanda Rwanda. DATA
This locale inherits from the DateTime::Locale::rw locale. It contains the following data. Days Wide (format) Kuwa mbere Kuwa kabiri Kuwa gatatu Kuwa kane Kuwa gatanu Kuwa gatandatu Ku cyumweru Abbreviated (format) mbe. kab. gtu. kan. gnu. gnd. cyu. Narrow (format) 2 3 4 5 6 7 1 Wide (stand-alone) Kuwa mbere Kuwa kabiri Kuwa gatatu Kuwa kane Kuwa gatanu Kuwa gatandatu Ku cyumweru Abbreviated (stand-alone) mbe. kab. gtu. kan. gnu. gnd. cyu. Narrow (stand-alone) 2 3 4 5 6 7 1 Months Wide (format) Mutarama Gashyantare Werurwe Mata Gicuransi Kamena Nyakanga Kanama Nzeli Ukwakira Ugushyingo Ukuboza Abbreviated (format) mut. gas. wer. mat. gic. kam. nya. kan. nze. ukw. ugu. uku. Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 Wide (stand-alone) Mutarama Gashyantare Werurwe Mata Gicuransi Kamena Nyakanga Kanama Nzeli Ukwakira Ugushyingo Ukuboza Abbreviated (stand-alone) mut. gas. wer. mat. gic. kam. nya. kan. nze. ukw. ugu. uku. Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 Quarters Wide (format) igihembwe cya mbere igihembwe cya kabiri igihembwe cya gatatu igihembwe cya kane Abbreviated (format) I1 I2 I3 I4 Narrow (format) 1 2 3 4 Wide (stand-alone) igihembwe cya mbere igihembwe cya kabiri igihembwe cya gatatu igihembwe cya kane Abbreviated (stand-alone) I1 I2 I3 I4 Narrow (stand-alone) 1 2 3 4 Eras Wide BCE CE Abbreviated BCE CE Narrow BCE CE Date Formats Full 2008-02-05T18:30:30 = Kuwa kabiri, 2008 Gashyantare 05 1995-12-22T09:05:02 = Kuwa gatanu, 1995 Ukuboza 22 -0010-09-15T04:44:23 = Kuwa gatandatu, -10 Nzeli 15 Long 2008-02-05T18:30:30 = 2008 Gashyantare 5 1995-12-22T09:05:02 = 1995 Ukuboza 22 -0010-09-15T04:44:23 = -10 Nzeli 15 Medium 2008-02-05T18:30:30 = 2008 gas. 5 1995-12-22T09:05:02 = 1995 uku. 22 -0010-09-15T04:44:23 = -10 nze. 15 Short 2008-02-05T18:30:30 = 08/02/05 1995-12-22T09:05:02 = 95/12/22 -0010-09-15T04:44:23 = -10/09/15 Default 2008-02-05T18:30:30 = 2008 gas. 5 1995-12-22T09:05:02 = 1995 uku. 22 -0010-09-15T04:44:23 = -10 nze. 15 Time Formats Full 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Long 2008-02-05T18:30:30 = 18:30:30 UTC 1995-12-22T09:05:02 = 09:05:02 UTC -0010-09-15T04:44:23 = 04:44:23 UTC Medium 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Short 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 09:05 -0010-09-15T04:44:23 = 04:44 Default 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 09:05:02 -0010-09-15T04:44:23 = 04:44:23 Datetime Formats Full 2008-02-05T18:30:30 = Kuwa kabiri, 2008 Gashyantare 05 18:30:30 UTC 1995-12-22T09:05:02 = Kuwa gatanu, 1995 Ukuboza 22 09:05:02 UTC -0010-09-15T04:44:23 = Kuwa gatandatu, -10 Nzeli 15 04:44:23 UTC Long 2008-02-05T18:30:30 = 2008 Gashyantare 5 18:30:30 UTC 1995-12-22T09:05:02 = 1995 Ukuboza 22 09:05:02 UTC -0010-09-15T04:44:23 = -10 Nzeli 15 04:44:23 UTC Medium 2008-02-05T18:30:30 = 2008 gas. 5 18:30:30 1995-12-22T09:05:02 = 1995 uku. 22 09:05:02 -0010-09-15T04:44:23 = -10 nze. 15 04:44:23 Short 2008-02-05T18:30:30 = 08/02/05 18:30 1995-12-22T09:05:02 = 95/12/22 09:05 -0010-09-15T04:44:23 = -10/09/15 04:44 Default 2008-02-05T18:30:30 = 2008 gas. 5 18:30:30 1995-12-22T09:05:02 = 1995 uku. 22 09:05:02 -0010-09-15T04:44:23 = -10 nze. 15 04:44:23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 kab. 1995-12-22T09:05:02 = 22 gnu. -0010-09-15T04:44:23 = 15 gnd. Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 MEd (E, M-d) 2008-02-05T18:30:30 = kab., 2-5 1995-12-22T09:05:02 = gnu., 12-22 -0010-09-15T04:44:23 = gnd., 9-15 MMM (LLL) 2008-02-05T18:30:30 = gas. 1995-12-22T09:05:02 = uku. -0010-09-15T04:44:23 = nze. MMMd (MMM d) 2008-02-05T18:30:30 = gas. 5 1995-12-22T09:05:02 = uku. 22 -0010-09-15T04:44:23 = nze. 15 MMMEd (E MMM d) 2008-02-05T18:30:30 = kab. gas. 5 1995-12-22T09:05:02 = gnu. uku. 22 -0010-09-15T04:44:23 = gnd. nze. 15 MMMMd (MMMM d) 2008-02-05T18:30:30 = Gashyantare 5 1995-12-22T09:05:02 = Ukuboza 22 -0010-09-15T04:44:23 = Nzeli 15 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = kab. Gashyantare 5 1995-12-22T09:05:02 = gnu. Ukuboza 22 -0010-09-15T04:44:23 = gnd. Nzeli 15 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = kab., 2008-2-5 1995-12-22T09:05:02 = gnu., 1995-12-22 -0010-09-15T04:44:23 = gnd., -10-9-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 gas. 1995-12-22T09:05:02 = 1995 uku. -0010-09-15T04:44:23 = -10 nze. yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = kab., 2008 gas. 5 1995-12-22T09:05:02 = gnu., 1995 uku. 22 -0010-09-15T04:44:23 = gnd., -10 nze. 15 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 Gashyantare 1995-12-22T09:05:02 = 1995 Ukuboza -0010-09-15T04:44:23 = -10 Nzeli yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 I1 1995-12-22T09:05:02 = 1995 I4 -0010-09-15T04:44:23 = -10 I3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week Kuwa mbere SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.18.2 2017-10-06 DateTime::Locale::rw_RW(3)
All times are GMT -4. The time now is 10:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy