Sponsored Content
Operating Systems Linux Debian Using sed with bash variables Post 302945891 by Scrutinizer on Thursday 4th of June 2015 10:25:56 AM
Old 06-04-2015
So that would mean that the variable WEBSITE contained the text mm.mm . Could that be?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

using sed on bash variables (or maybe awk?)

Hi all- I've been fooling with this for a few days, but I'm rather new at this... I have a bash variable containing a long string of various characters, for instance: JUNK=this that the other xyz 1234 56 789 I don't know what "xyz" actually is, but I know that: START=he other and ... (2 Replies)
Discussion started by: rev66
2 Replies

2. Shell Programming and Scripting

Bash variables

Ummm can anybody help me with this one? Its prob quite simple. I bascially have a file name say J1x2x3x7.dat Im using the file name as a variable in a bash script. Want I want to do is extract most of the file name and make it a new variable expect with say one of the number now a... (2 Replies)
Discussion started by: RichieFondel
2 Replies

3. Shell Programming and Scripting

how to use in bash variables and quotes

I have some troubles with variables and quotes... I want: if $URL is empty (no user input) go to http://www.localhost/index.php/ else add this string (search) "?s=+$URL" EXAMPLE: No user input string= http://www.localhost/index.php/ User input = "unix" string=... (3 Replies)
Discussion started by: aspire
3 Replies

4. UNIX for Dummies Questions & Answers

Expanding variables with Ed Bash 3.2.33

Hi, The following code finds the line containing fruits in test.txt and replaces instances of apple with banana. ed -s test.txt <<< $'/fruits/s/apple/banana/g\nw' What I want to do is put variables in the place of fruits, apple and banana. I have tried replacing ' with " to get... (2 Replies)
Discussion started by: de_la_espada
2 Replies

5. Shell Programming and Scripting

Complex bash/sed, variables and nested quotes

Ok, this one isn't for everybody, it's pretty tough and I've spent a good deal of time on it without figuring it out yet. Can anybody get this script to work: #!/bin/bash cq_fname="%let outputfile="/user/cq_"$1".csv";" sed "29s/.*/\"$cq_fname\"/" file1.sas >... (3 Replies)
Discussion started by: nocloud
3 Replies

6. Shell Programming and Scripting

Indirect variables in Bash

Hello, I've spent hours this morning reading various past forum posts and documentation pages but I can't find exactly what I need. I'm trying to call a variable with a variable in the name without having to make a third variable. For example: path=AB legAB=50 leg$path I want to... (8 Replies)
Discussion started by: DFr0st
8 Replies

7. Shell Programming and Scripting

BASH arrays and variables of variables in C++

Sometimes it is handy to protect long scripts in C++. The following syntax works fine for simple commands: #define SHELLSCRIPT1 "\ #/bin/bash \n\ echo \"hello\" \n\ " int main () { cout <<system(SHELLSCRIPT1); return 0; } Unfortunately for there are problems for: 1d arrays:... (10 Replies)
Discussion started by: frad
10 Replies

8. Shell Programming and Scripting

Expect - bash and variables

I was wondering if anyone could provide some assistance. I trying to run an expect script within bash and get the results of a variable called RESULT. I Have tried a few things but none of them have worked. I know that the child process (the expect script) in this instance cannot set a variable... (6 Replies)
Discussion started by: ylafont
6 Replies

9. Shell Programming and Scripting

Passing awk variables to bash variables

Trying to do so echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies
SIGNIFY(1)						  Generate Semi-Random Signatures						SIGNIFY(1)

NAME
signify - Program to generate semi-random signatures SYNOPSIS
signify [--fifo=$HOME/.signature] [--input=file] [--debug] DESCRIPTION
Signify will take a signature description file ( ~/.signify or whatever file is specified by the --input=<file> option ) and create a ran- dom signature based on the information contained therein. This allows the ability to do such things as pick a random quote for each mes- sage sent. Signify, by default, will write the generated signature to standard output from where it can be redirected to overwrite the .signature file. Alternatively, Signify can pipe it's output to a given 'fifo'. Each read from that file will return a different signature. To use the FIFO feature, delete the current "$HOME/.signature" file and start Signify in the background like "signify --fifo=$HOME/.signa- ture &". With this running, try "cat $HOME/.signature" a few times. A different signature will be returned each time. (Note: This fea- ture will probably work only on unix systems.) The --debug switch causes Signify to generate messages on what it is doing to stderr. This switch is only meant to be useful to the pro- gram's maintainers. CONFIGURATION
The definition for the generated signatures is contained entirely within the .signify file contained in the user's home directory. Any completely empty lines (lines with even a single space are considered part of the signature data) and those lines starting with a hash character (#) are completely ignored. Those lines starting with a percent sign (%) are considered commands and affect the way Signify behaves. Perl Command Substitution Signify can execute an arbitrary perl code fragment during the initial reading of the configuration file. This can be used, for example, to choose values or text depending on the environment in which Signify is being run. To use this feature, simply enclose the desired perl code in back-tics (i.e. `perl code`). Whatever the perl code evaluates to will be substituted in that spot. No further variable substitu- tions are made on the resulting text. Signify is intelligent enough to recognize two back-tics together (often used as a better looking quotation mark) as not being a code fragment. Thus, writting something like "``Stop,'' she said." will appear as expected. Note: The entire code fragment must be contained on a single line of the input file. Defining Variables Signify will substitute variables within each line of the signature in much the same way as the shell would. Any sequence of $WORD; will be replaced by the value corresponding to the name "WORD". Case is significant but the trailing semicolon may be omitted if the next char- acter is not a letter, digit, or underscore. By default, these variables look up values inside the environment variables, but can also be defined or redefined within the .signify file itself with a command such as: % $email=myid@mycompany.com Everything after the equal sign (=) is considered part of the value. Variables can be used in the definition of other variables. As a special case, $$ will evaluate to a single dollar sign ($). The special variable SIGWIDTH can be used to set the desired output width of the generated signature. By default, this variable has the value "79". There is also a BLANK variable you can place on a line to create a totally empty line when the signature is output. Including Other Files You can tell Signify to read another file in place of the current line with a command like: % include $HOME/.signify-quotes For convienence, you can use a tilde (~) instead of $HOME to read a file relative to your home directory. Creating Alternates An unlimited number of "alternates" can be specified by using the "{", "|", and "}" commands. When the signature is generated, only one of all the possible alternates will be output. For example: % { This is the first possibility. % | This is the second possibility. % | This is the third (and last) possibility. Note that alternatives can span multiple lines. % } Creating Columns Signify will automatically create side-by-side columns with nice, even spacing by using the "(", "|", and ")" commands. When output, everything will be padded out with spaces to fit nicely on the line. For example: % ( This is the first column. % | This is the second. % | This is the third (and last) column. % ) Nesting Sections Alternates and columns can be nested to any depth, though this can quickly become unwieldy and may not work exactly as expected, especially with columns. As a general rule, only supply alignment options (eg. "center", "right") at the most outside level to do any text format- ting. For example, if supplying multiple "alternates" within a column, put the alignment options on the column and not on the alternates. Section Command Options The "alternates" and "columns" commands can take options to alter how they behave. The following is a list of supported options and what they do, though not all have meaning for both types of section. Multiple options can be specified by separating them with a comma (,). bottom push the following lines of text to the bottom of a column should it have fewer lines than the longest column. This option has no meaning to "alternates" sections. center adjust the following lines to be centered on the page or in the column. When used in an "alternates" section, an additional "=<num- ber>" can be used to specify what column to center around instead of the middle of the page. exec treat the following lines not as text to be included in the column or alternate, but as commands to be executed by the shell. For each command executed, if its return status is 0 then the output it produced is included at that point, otherwise the output is dis- carded. Any included text is then aligned, etc. as usual. This command is most useful for inserting random quotes generated by programs such as fortune(6). left adjust the following lines so they sit at the left margin. This is the default horizontal alignment and most closely reflects how the lines are entered into the .signify file itself. Note that pad spaces will still be placed on both sides of a column with this type of alignment unless the minwidth option is also specified. minwidth do not pad the left and right sides of this column when placing next to other columns. This is useful for building column separator lines and the like that are not really part of the content. This option has no meaning to "alternates" sections. repeat output the following lines multiple times to fill all lines in the column. This is useful for building column separator lines and the like that are just a repeated sequence. A multi-line sequence can be specified and only those lines necessary to fill the col- umn will be output. The entire sequence will be output in its entirety at least once, however. This option has no meaning to "alternates" sections. right adjust the following lines so they sit at the right margin. Note that pad spaces will still be placed on both sides of a column with this type of alignment unless the minwidth option is also specified. top push the following lines of text to the top of a column should it have fewer lines than the longest column. This is the default action if no vertical centering is specified. This option has no meaning to "alternates" sections. vcenter push the following lines of text in the vertical center of a column should it have fewer lines than the longest column. This option has no meaning to "alternates" sections. weight=<number> change the likelihood a given alternate will be chosen. The chance of any specific alternate being chosen is the given <number> divided by the total of all weights. If not specified, the weight defaults to 1.0. Decimal numbers and numbers less that 1.0 are allowed. This option has no meaning to "columns" sections. THE COST OF FREE SOFTWARE
Let's face it: Somebody has to pay for all software that gets written. Whether it is the time donated by the programmer or the salary donated by the company, everything has its cost. Signify has been made available to the general public in the hope that it will be useful and thus help raise the visibility of the people that sponsored its creation. In this way, the cost of creating Signify is offset by the publicity gained. If you use this program and would like to further the development of such software, it is asked (but by no means required) that you put something like the following in the quotes section of your .signify file. % | center, weight=0.1 Generated by $PROGRAM. For this and more, visit $WEBSITE (for single-line quote) or (for multi-line in a column) % | weight=0.1 This signature was automatically generated with $PROGRAM. For this and other cool products, check out $WEBSITE These are weighted very low (though you are more than welcome to increase these weightings :-) and will thus show up in your signature only occasionally. The variables are defined internal to Signify and provide the program name (including version number) and the web site where it can be found. We thank you for your support! BUGS
Please report any bugs to: bcwhite@pobox.com AUTHOR
Signify was written and documented by Brian White <bcwhite@pobox.com> on August 24th, 1996. COPYRIGHT
Signify has been placed in the public domain, the only true "free". It would be apprecated if copies of any improvements or bug-fixes would be sent to the author in order to be incorporated into the main upstream code and propogated to all users of this software. 96.08.24 Public domain by Brian White SIGNIFY(1)
All times are GMT -4. The time now is 09:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy