Sponsored Content
Top Forums Shell Programming and Scripting Using Sed to do a substitution inside ksh Post 302565373 by Calbrenar on Monday 17th of October 2011 04:54:33 PM
Old 10-17-2011
well that was painless. I thought you needed the ` to run a command. Thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh substitution

Hello, I thought it was possible to use several time a #! entry on a script but it doesn't seems to work. My need is to have a part of a ksh script without substitution so it would look like #!/bin/ksh -- first part --- #!/bin/ksh -f -- part without substitution -- #!/bin/ksh --... (2 Replies)
Discussion started by: solea
2 Replies

2. Shell Programming and Scripting

KSH variable substitution

Hi folks Please let me know if anyone knows how to handle this. My KSH script -> testscript.ksh cmd=$1 ENV="devl" echo $cmd This is how I call the script ./testscript.ksh 'ps -ef | grep br$ENV' How do I get this to print the below text i.e $ENV should be substituted with the value... (5 Replies)
Discussion started by: tipsy
5 Replies

3. Solaris

Substitution not working in ksh

Hi, Following code is working in bash but not in ksh. Can someone please send me an alternative? #!/bin/ksh fname="EOA.dmp" echo $fname logname=${fname/.dmp/.log} echo $logname I am getting below error in ksh "testcmd: logname=${fname/.dmp/.log}: 0403-011 The specified substitution... (3 Replies)
Discussion started by: arsheshadri
3 Replies

4. Shell Programming and Scripting

String substitution on find results inside exec/xargs

What I'm trying to do is perform a copy, well a ditto actually, on the results of a find command, but some inline string substitution needs to happen. So if I run this code find ./ -name "*.tif" I get back these results. .//1234567.tif .//abcdefg.tif Now the action from exec or xargs I... (2 Replies)
Discussion started by: myndcraft
2 Replies

5. Shell Programming and Scripting

variable substitution in ksh

Hi I have a variable BIT1 which holds some value. Is there a way to retrieve the value of this variable indirectly via another variable, lets say SUBSET_BIT_NUM=1, so the call will look something like this: sundev1 $ echo ${BIT${SUBSET_BIT_NUM}} ksh: ${BIT${SUBSET_BIT_NUM}}: bad substitution ... (3 Replies)
Discussion started by: aoussenko
3 Replies

6. Shell Programming and Scripting

KSH: substitution character, AWK or SED?

Hi Gurus, I am working with a korn shell script. I should replace in a very great file the character ";" with a space. Example: 2750;~ 2734;~ 2778;~ 2751;~ 2751;~ 2752;~ what the fastest method is? Sed? Awk? Speed is dead main point, Seen the dimensions of the files Thanks (6 Replies)
Discussion started by: GERMANICO
6 Replies

7. Shell Programming and Scripting

Using commands inside sed substitution

Dear Friends, Please let me know how to use the date command inside the substitution flag replacement string. echo "01 Jan 2003:11:00:06 +0100" | sed 's/\(.*\)/`date -d \1 "+%Y%m%d%H%M%S"`/' I want to supply \1 string to Here mention below as part of replacement string, date -d <Here>... (5 Replies)
Discussion started by: tamil.pamaran
5 Replies

8. UNIX for Dummies Questions & Answers

Variable inside command substitution

Hello people. Part of my script: SUBSETID=`echo $PMFILE |sed 's/pmresult_//' | sed 's/_*//'` MAPFILE=`find /huawei/cell /huawei/nodeb /huawei/rnc -name 'mapping_$SUBSETID.txt' |grep -v backup` Unfortunatelly variable $SUBSETID in the MAPFILE declaration will not return the... (3 Replies)
Discussion started by: drbiloukos
3 Replies

9. Shell Programming and Scripting

Command substitution inside of a variable expression (AIX, KORN)

Hello all. This is my first post/question on this site. I’m a new Systems Analyst with previous experience with BASH. Although now I'm using AIX, and I’m trying to get a feel for the Korn shell (for those of you that don’t know AIX only uses the KORN shell). I hope I put this into the correct... (10 Replies)
Discussion started by: sydox
10 Replies

10. Shell Programming and Scripting

sed command not working inside ksh script but works fine outside

Hi, I am a bit confused ,why would a sed command work fine outside of ksh script but not inside. e.g I want to replace all the characters which end with a value and have space at end of it. so my command for it is : sed -i "s/$SEPARATOR /$SEPARATOR/g" file_name This is working fine in... (8 Replies)
Discussion started by: vital_parsley
8 Replies
Mojolicious::Guides::CodingGuidelines(3pm)		User Contributed Perl Documentation		Mojolicious::Guides::CodingGuidelines(3pm)

NAME
Mojolicious::Guides::CodingGuidelines - Coding guidelines OVERVIEW
This document describes the coding guidelines that are the foundations of Mojo and Mojolicious development. Please do not send patches unless you agree with them. MISSION STATEMENT
Mojo is a runtime environment for Perl real-time web frameworks. It provides all the basic tools and helpers needed to write simple web applications and higher level web frameworks such as Mojolicious. All components should be reusable in other projects and in a UNIXish way only loosely coupled. Especially for people new to Perl it should be as easy as possible to install Mojolicious and get started. Writing web applications can be one of the most fun ways to learn a language! For developers of other web frameworks it should be possible to reuse all the infrastructure and just consider the higher levels of the Mojolicious distribution an example application. RULES
Web development should be easy and fun, this is what we optimize for. The web is a moving target, to stay relevant we have to stay in motion too. Keep it simple, no magic unless absolutely necessary. The installation process should be as fast and painless as possible. (Less than a minute on most common hardware is a good rule of thumb) The addition and modification of features is decided by majority vote or the pumpking. Any core developer may nominate a new one, who must then be accepted by a 2/3 majority vote. The pumpking has veto rights and may select his successor. It's not a feature without a test and documentation. A feature is only needed when the majority of the userbase benefits from it. Features may only be changed in a major release or after being deprecated for at least 3 months. Refactoring and deprecations should be avoided if no important feature depends on it. New features can be marked as experimental to be excluded from deprecation policies. A major release is signaled by a new major version number and a unique code name based on a unicode character. Only add dependencies if absolutely necessary and make them optional if possible. Domain specific languages should be avoided in favor of Perl-ish solutions. No inline POD. Documentation belongs to the guides, module POD is just an API reference. The main focus of the included documentation should be on examples, no walls of text. (An example for every one or two sentences is a good rule of thumb) Everything should be ordered alphabetically if possible. The master source code repository should always be kept in a stable state, use feature branches for actual development. Code has to be run through Perl::Tidy with the included ".perltidyrc", and everything should look like it was written by a single person. Code should be organized in blocks and those blocks should be commented. No spaghetti code. Comments should be correctly capitalized, and funny if possible, punctuation is optional if it doesn't increase readability. Every file should contain at least one quote from "The Simpsons" or "Futurama". No names outside of "Mojolicious.pm". No Elitism. Peace! MORE
You can continue with Mojolicious::Guides now or take a look at the Mojolicious wiki <http://github.com/kraih/mojo/wiki>, which contains a lot more documentation and examples by many different authors. perl v5.14.2 2012-09-05 Mojolicious::Guides::CodingGuidelines(3pm)
All times are GMT -4. The time now is 07:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy