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
docidx_lang_cmdref(3tcl)					Documentation tools					  docidx_lang_cmdref(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
docidx_lang_cmdref - docidx language command reference SYNOPSIS
comment plaintext include filename index_begin text title index_end key text lb manpage file text rb url url label vset varname value vset varname _________________________________________________________________ DESCRIPTION
This document specifies both names and syntax of all the commands which together are the docidx markup language, version 1. As this docu- ment is intended to be a reference the commands are listed in alphabetical order, and the descriptions are relatively short. A beginner should read the much more informally written docidx language introduction first. COMMANDS
comment plaintext Index markup. The argument text is marked up as a comment standing outside of the actual text of the document. Main use is in free- form text. include filename Templating. The contents of the named file are interpreted as text written in the docidx markup and processed in the place of the include command. The markup in the file has to be self-contained. It is not possible for a markup command to cross the file bound- aries. index_begin text title Document structure. The command to start an index. The arguments are a label for the whole group of documents the index refers to (text) and the overall title text for the index (title), without markup. The label often is the name of the package (or extension) the documents belong to. index_end Document structure. Command to end an index. Anything in the document coming after this command is in error. key text Index structure. This command adds the keyword text to the index. lb Text. The command is replaced with a left bracket. Use in free-form text. Required to avoid interpretation of a left bracket as the start of a markup command. Its usage is restricted to the arguments of other markup commands. manpage file text Index structure. This command adds an element to the index which refers to a document. The document is specified through the sym- bolic name file. The text argument is used to label the reference. Symbolic names are used to preserve the convertibility of this format to any output format. The actual name of the file will be inserted by the chosen formatting engine when converting the input. This will be based on a mapping from symbolic to actual names given to the engine. rb Text. The command is replaced with a right bracket. Use in free-form text. Required to avoid interpretation of a right bracket as the end of a markup command. Its usage is restricted to the arguments of other commands. url url label Index structure. This is the second command to add an element to the index. To refer to a document it is not using a symbolic name however, but a (possibly format-specific) url describing the exact location of the document indexed here. vset varname value Templating. In this form the command sets the named document variable to the specified value. It does not generate output. I.e. the command is replaced by the empty string. vset varname Templating. In this form the command is replaced by the value of the named document variable BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category doctools of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. SEE ALSO
docidx_intro, docidx_lang_faq, docidx_lang_intro, docidx_lang_syntax KEYWORDS
docidx commands, docidx language, docidx markup, markup, semantic markup CATEGORY
Documentation tools COPYRIGHT
Copyright (c) 2007 Andreas Kupries <andreas_kupries@users.sourceforge.net> doctools 1.0 docidx_lang_cmdref(3tcl)
All times are GMT -4. The time now is 05:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy