Sponsored Content
Top Forums Shell Programming and Scripting Help cannot concatenate Ksh variables ? Post 302600234 by pcpinkerton on Monday 20th of February 2012 12:31:25 PM
Old 02-20-2012
The script was written on a RedHat linux server using vi
The script was ran on the same Linux server using directories copied from a Windows server to a NAS mounted to the Linux server.

This post was created from an iMac (lion 10.7.x) using TexEditor application ( cut and paste from linux vi saved files.

in each path below there is a .svn/entries file the hostname is extracted from this file

snip from PathList:
Code:
/webdata/tmpDNAbld/PDSApp/PDSScrPd/Source
/webdata/tmpDNAbld/PDSApp/PDSScrPd/Source/Distrib
/webdata/tmpDNAbld/PDSApp/PDSScrPd/Source/Distrib/Release
/webdata/tmpDNAbld/PDSApp/PDSScrPd/Source/BC
/webdata/tmpDNAbld/PDSApp/PDSExclusive/Source/PDSExclusive
/webdata/tmpDNAbld/PDSApp/PDSExclusive/Source/PDSExclusive/Distrib
/webdata/tmpDNAbld/PDSApp/PDSExclusive/Source/PDSExclusive/Distrib/Release
/webdata/tmpDNAbld/PDSApp/PDSExclusive/Source/PDSExclusive/BC
/webdata/tmpDNAbld/PDSApp/PDSCompare/Source
/webdata/tmpDNAbld/PDSApp/PDSCompare/Source/distrib
/webdata/tmpDNAbld/PDSApp/PDSCompare/Source/distrib/release
/webdata/tmpDNAbld/PDSApp/PDSCompare/Source/BC
/webdata/tmpDNAbld/PDSApp/PDSOrganization/Source
/webdata/tmpDNAbld/PDSApp/PDSOrganization/Source/Distrib
/webdata/tmpDNAbld/PDSApp/PDSOrganization/Source/Distrib/Release
/webdata/tmpDNAbld/PDSApp/PDSOrganization/Source/BC
/webdata/tmpDNAbld/PDSApp/PDSMassXfer/Source
/webdata/tmpDNAbld/PDSApp/PDSMassXfer/Source/Distrib
/webdata/tmpDNAbld/PDSApp/PDSMassXfer/Source/Distrib/Release
/webdata/tmpDNAbld/PDSApp/PDSMassXfer/Source/BC
/webdata/tmpDNAbld/PDSApp/PDSBatch/Source


Last edited by Scott; 02-22-2012 at 02:22 PM.. Reason: Code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

variables in ksh

I'm new to unix scripting. How would I go about pulling the first 3 characters from a variable in ksh and storing in another variable? Thanks. (9 Replies)
Discussion started by: steve6368
9 Replies

2. Shell Programming and Scripting

subtracting variables in ksh

hi all, how do i subract variables in shell ?? am trying to space out the headers and the output generated by the shell so they all line up : currently the output is like this : servers : users server1 : 10 latestServer : 50 so i thought... (3 Replies)
Discussion started by: cesarNZ
3 Replies

3. Shell Programming and Scripting

how to concatenate values of two variables with an underscore(_) in between

Hi, I'm new to shell programming. I have two variables a and b a=val1 b=val2 could anyone kindly post the shell script to concatenate the values of variable a and b with an underscore(_) in between? The final output should be val1_val2. (8 Replies)
Discussion started by: badrimohanty
8 Replies

4. Shell Programming and Scripting

How to preserve NL in Ksh variables?

I'm trying to set a variable to the output of a command. This is what the comand output to the display looks like: />hciconndump -v TOsiu Dump of connection(s): TOsiu ---------------------------------------------------------------------- Process: A60Tsiu Connection: TOsiu... (2 Replies)
Discussion started by: troym72
2 Replies

5. Shell Programming and Scripting

Combining two variables in ksh

I can't believe I can't figure this out... given this code: CARS_DATA_LIST=`cat /tmp/file1 | awk '{print $1}' ` FMSA_DATA_LIST=`cat /tmp/file2 | awk '{print $1}' ` The value of each of the above variables is: CARS = a b c d e f g FMSA = a b c q r s I want to declare a third... (8 Replies)
Discussion started by: Shoeless_Mike
8 Replies

6. Shell Programming and Scripting

concatenate variables problem

Hello, I have a tricky problem: I have a $file with a variable number of occurrences of "ORA-" (in this case two) .......... EXP-00008: ORACLE error 3113 encountered ORA-03113: end-of-file on communication channel EXP-00056: ORACLE error 1403 encountered ORA-01403: no data found... (9 Replies)
Discussion started by: Laurentiu
9 Replies

7. Shell Programming and Scripting

ksh - for loop with variables

Hi, I 'm trying to send an e-mail for every different line in the .txt for i in {1..$variable} do sed -n "/$i$/p" text.txt done I have two problems about this. First one is that for loop doesn't work and the second one is that i cant get the output of sed (4 Replies)
Discussion started by: ozum
4 Replies

8. Shell Programming and Scripting

concatenate variables

I need to know how to concatenate variables in Debian. I am making a interactive script where it ask the user for info to add a user I pull the first letter from the first middle and last name into individual variables now i want to put them all in one variable so i can put it into useradd command ... (4 Replies)
Discussion started by: HackerSeabass
4 Replies

9. UNIX for Dummies Questions & Answers

Formating variables in KSH

Hi Friends , I want to know how to format the output for the following: i searched in the forum and couldnt get the exact requirement. Thanks in advance . (2 Replies)
Discussion started by: i150371485
2 Replies

10. Shell Programming and Scripting

Concatenate two variables and form the third variable

Hi Guys, I was scratching my head for this for half a day... finally not successful :confused: Following is the problem I have a variable $ var1=123 $ var2-234 $ var3=345 and another Variable $ i=1 Now i wanted to save these into a Variable as shown below for i in 1 2 3 do... (5 Replies)
Discussion started by: ramprabhum
5 Replies
CGI::FormBuilder::Source(3pm)				User Contributed Perl Documentation			     CGI::FormBuilder::Source(3pm)

NAME
CGI::FormBuilder::Source - Source adapters for FormBuilder SYNOPSIS
# Define a source adapter package CGI::FormBuilder::Source::Whatever; sub new { my $self = shift; my $class = ref($self) || $self; my %opt = @_; return bless \%opt, $class; } sub parse { my $self = shift; my $file = shift || $self->{source}; # open the file and parse it, or whatever my %formopt; open(F, "<$file") || die "Can't read $file: $!"; while (<F>) { # ... do stuff to the line ... $formopt{$fb_option} = $fb_value; } # return hash of $form options return wantarray ? %formopt : \%formopt; } DESCRIPTION
This documentation describes the usage of FormBuilder sources, as well as how to write your own source adapter. An external source is invoked by using the "source" option to the top-level "new()" method: my $form = CGI::FormBuilder->new( source => 'source_file.conf' ); This example points to a filename that contains a file following the "CGI::FormBuilder::Source::File" layout. Like with the "template" option, you can also specify "source" as a reference to a hash, allowing you to use other source adapters: my $form = CGI::FormBuilder->new( fields => @fields, source => { type => 'File', source => '/path/to/source.conf', } ); The "type" option specifies the name of the source adapter. Currently accepted types are: File - CGI::FormBuilder::Source::File In addition to one of these types, you can also specify a complete package name, in which case that module will be autoloaded and its "new()" and "parse()" routines used. For example: my $form = CGI::FormBuilder->new( fields => @fields, source => { type => 'My::Source::Module', somefile => '/path/to/source.conf', } ); All other options besides "type" are passed to the constructor for that source module verbatim, so it's up to you and/or the source module on how these additional options should be handled. SEE ALSO
CGI::FormBuilder, CGI::FormBuilder::Source::File, REVISION
$Id: Source.pm 100 2007-03-02 18:13:13Z nwiger $ AUTHOR
Copyright (c) Nate Wiger <http://nateware.com>. All Rights Reserved. This module is free software; you may copy this under the terms of the GNU General Public License, or the Artistic License, copies of which should have accompanied your Perl kit. perl v5.14.2 2011-09-16 CGI::FormBuilder::Source(3pm)
All times are GMT -4. The time now is 12:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy