Sponsored Content
Top Forums Shell Programming and Scripting Variable not passed to the sed command Post 302937570 by Scrutinizer on Friday 6th of March 2015 09:11:55 AM
Old 03-06-2015
The variable Index needs to be set outside the here-document, if you want to use it inside the here-document.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

variable passed to awk

Anybody know what's wrong with this syntax? awk -v job="$job" 'BEGIN { FS="|"} {print $1,$2," ",$4," ",$3\n,$5,"\n"}' list It's keeping give me this message: awk: syntax error near line 1 awk: bailing out near line 1 It seems awk has problem with my BEGIN command. Any... (8 Replies)
Discussion started by: whatisthis
8 Replies

2. UNIX for Dummies Questions & Answers

variable passed to awk

Does anybody know how to print a variable passed to awk command? awk -F"|" 'BEGIN {print $job,"\n","Question \n"} {print $1,$2$4," ",$3}' "job=$job1" file1 I am trying to pass job the variable job1. the output is blank. ?? (3 Replies)
Discussion started by: whatisthis
3 Replies

3. Shell Programming and Scripting

Insert a line including Variable & Carriage Return / sed command as Variable

I want to instert Category:XXXXX into the 2. line something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong: sed "2i\\${n}Category:$cat\n" Sample: Titel Blahh Blahh abllk sdhsd sjdhf Blahh Blah Blahh Blahh Should look like... (2 Replies)
Discussion started by: lowmaster
2 Replies

4. Shell Programming and Scripting

My variable cannot be passed through into my path

Hi, Can you please help. I am scripting in sh and I am trying to simply copy one directory to another but for some reason my variables are not recognised? echo "The latest version of the program is being found......." cd $SOFTWARE/src/$progname version=`ls $SOFTWARE/src/$progname | grep... (13 Replies)
Discussion started by: cyberfrog
13 Replies

5. UNIX for Dummies Questions & Answers

sed insert command and variable expansion/command substitution

I know this script is crummy, but I was just messing around.. how do I get sed's insert command to allow variable expansion to show the filename? #!/bin/bash filename=`echo $0` /usr/bin/sed '/#include/ { i\ the filename is `$filename` }' $1 exit 0 (8 Replies)
Discussion started by: glev2005
8 Replies

6. Shell Programming and Scripting

Why Perl Subroutine Passed In Variable is 1?

The following subroutine prints 1 instead of the content of the Equipment variable. Can someone tell me why? #!c:/perl/bin/perl.exe # use strict 'vars'; my $Equipments = "data/equips.txt"; unless (open(EQUIP_FH, "$Equipments")) { print "errors: $Equipments\n"; # This line prints... (1 Reply)
Discussion started by: tqlam
1 Replies

7. UNIX for Advanced & Expert Users

Value of variable not getting passed in child script

Hi, I am facing a challenge in fixing an issue in my installation scripts.Here is a situation: There are 3 files which are invoked at a below given order: Installer.ksh----->Installer.xml(Ant script)------->common.ksh I am outputting a message from common.ksh at a terminal, after that trying to... (3 Replies)
Discussion started by: baig_1988
3 Replies

8. Shell Programming and Scripting

In the sh file variable is not being passed on.

I am having difficulties with the fllowing script: !/bin/sh voicemaildir=/var/spool/asterisk/voicemail/$1/$2/INBOX/ echo `date` ':' $voicemaildir >> /var/log/voicemail-notify.log for audiofile in `ls $voicemaildir/*.wav`; do transcriptfile=${audiofile/wav/transcript} ... (4 Replies)
Discussion started by: ghurty
4 Replies

9. Shell Programming and Scripting

Variable passed as argument

I have a script. #!/bin/sh cur_$1_modify_time=Hello echo "cur_$1_modify_time" When I run like sh /root/script1 jj I expect value "Hello" being assigned to variable "cur_jj_modify_time" and output being "Hello" ie echoing $cur_jj_modify_time But the output comes as # sh... (3 Replies)
Discussion started by: anil510
3 Replies

10. Shell Programming and Scripting

Bash variable not being passed

In the bash below the variable date displays in the echo. However when I use it in the for loop it does not. Basically, the user inputs a date then that date is converted to the desired format of (month-day-year, no leading 0). That input is used in the for loop to return every file that matches... (5 Replies)
Discussion started by: cmccabe
5 Replies
Plucene::Index::SegmentInfos(3pm)			User Contributed Perl Documentation			 Plucene::Index::SegmentInfos(3pm)

NAME
Plucene::Index::SegmentInfos - A collection of SegmentInfo objects SYNOPSIS
my $segmentinfos = Plucene::Index::SegmentInfos->new; $segmentinfos->read($dir); $segmentinfos->write($dir); $segmentinfos->add_element(Plucene::Index::SegmentInfo $segment_info); my Plucene::Index::SegmentInfo @segment_info = $segmentinfos->segments; DESCRIPTION
This is a collection of Plucene::Index::SegmentInfo objects METHODS
new my $segmentinfos = Plucene::Index::SegmentInfos->new; This will create a new (empty) Plucene::Index::SegmentInfos object. read $segmentinfos->read($dir); This will read the segments file from the passed directory. write $segmentinfos->write($dir); This will write the segments info file out. add_element $segmentinfos->add_element(Plucene::Index::SegmentInfo $segment_info); This will add the passed Plucene::Index::SegmentInfo object.. info my Plucene::Index::SegmentInfo $info = $segmentinfos->info($segment_no); This will return the Plucene::Index::SegmentInfo object at the passed segment number. segments my Plucene::Index::SegmentInfo @segment_info = $segmentinfos->segments; This returns all the Plucene::Index::SegmentInfo onjects in this segment. perl v5.12.4 2011-08-14 Plucene::Index::SegmentInfos(3pm)
All times are GMT -4. The time now is 08:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy