I wrote about quoting shell variables not about embedding.
Maybe you true about awk but the "pretty bad" way is universal
It's a bad idea because it becomes language syntax, not merely a string. This is especially bad for a variable, where you might not have strict control over the exact contents:
Quote:
it's for perl
Quote:
...sed, python or almost anything other, where you want to embed shell variables.
I admit there's no good way to do it in sed, but this is an argument against sed, not an argument for that syntax. It's very difficult to safely put variables in sed because so many things need escaping.
And if the argument is that you don't need to memorize syntax for each language, well, you already had to memorize -e for perl, how much harder is -v, shift, etc?
Last edited by Corona688; 06-29-2011 at 12:42 PM..
Hi,
I need to know how I'll be able to write a script that can goto a different dir where I don't have access to read,write and execute and also to run a commandline prompt in that dir with one file whose path has to be specified in that command.
Will I be able to do this?
Any ideas or... (2 Replies)
Hi there,
I have a wapper script which passes the argument from command prompt to inner script.. It works fine as long as the argument containing single word. But when value contains multiple word with space, not working as expected. I tried my best, couldn't find the reason. Gurus, pls.... (2 Replies)
Hi All,
I am working on nawk script, has the small function which prints the output on the screen.Am trying to print/append the same output in a file.
Basically nawk script should print the output on the console/screen and as well it should write/append the same result to a file.
script :... (3 Replies)
Hi..I have the data in a file like in this format, and I need the output time difference in seconds by using awk command. Start date/time and end date/time given in column 2,3 & 4,5. Please assist how to write shell script.
File1.txt
JOB1 10/09/2013 17:42:16 10/09/2013 17:43:46 SU 6202685/1... (4 Replies)
solaris 5.10 Generic_138888-03 sun4v sparc SUNW,Sun-Fire-T200
I need a sed command that tests true when presented with lines that contain either forward and backslash.
input file:
c:/myFile.txt
c:\yourFile.txt
It doesn't appear that sed (in my environment anyway) supports... (4 Replies)
Hello all,
I have a question regarding the difference betwen cron and command line.
What I would like to do is to print a statement into a logfile if a script has been executed from cron or from command line.
It should be as:
#!/bin/bash
if <Check if this script has been... (3 Replies)
Hi,
I'm trying to write a script to determine the time gap between HTTP PUT and HTTP DELETE requests in the HTTP Servers access log.
Normally client will do HTTP PUT to push content e.g. file_1.txt and 21 seconds later it will do HTTP DELETE, but sometimes the time varies causing some issues... (3 Replies)
In the awk I am trying to subtract the difference $3-$2 of each matching $4 before the first _ (underscore) and print that value in $13.
I think the awk will do that, but added comments. What I am not sure off is how to add a line or lines that will add sum each matching $13 value and put it in... (2 Replies)
Hello,
For my CGI, I have this script :
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo '
<html>
<head>
<meta http-equiv="Content-Type" content="test/html"; charset=UTF-8">
<title> CLF MONITORING </title>
<h1> FRAME... (4 Replies)
Discussion started by: Tim2424
4 Replies
LEARN ABOUT DEBIAN
recins
RECINS(1) User Commands RECINS(1)NAME
recins - insert records in a recfile
SYNOPSIS
recins [OPTION]... [t TYPE] [-n NUM | -e EXPR | -q STR | -m NUM] [(-f STR -v STR]|[-R RECDATA)]... [FILE]
DESCRIPTION
Insert new records in a rec database.
-f, --field=STR
field name; should be followed by a -v.
-v, --value=STR
field value; should be preceded by an -f.
-r, --record=STR
record that will be inserted in the file.
--force
insert the record even if it is violating record restrictions.
--no-external
don't use external descriptors.
--no-auto
don't insert auto generated fields.
--verbose
give a detailed report if the integrity check fails.
-s, --password=STR
encrypt confidential fields with the given password.
--help print a help message and exit.
--version
show version and exit.
Record selection options:
-i, --case-insensitive
make strings case-insensitive in selection expressions.
-t, --type=TYPE
operate on records of the specified type only.
-e, --expression=EXPR
selection expression.
-q, --quick=STR
select records with fields containing a string.
-n, --number=NUM,...
select specific records by position, with ranges.
-R, --random=NUM
select a given number of random records.
If no FILE is specified then the command acts like a filter, getting the data from standard input and writing the result to standard out-
put.
AUTHOR
Written by Jose E. Marchesi.
REPORTING BUGS
Report bugs to: bug-recutils@gnu.org
GNU recutils home page: <http://www.gnu.org/software/recutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
COPYRIGHT
Copyright (C) 2010, 2011, 2012 Jose E. Marchesi. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for recins is maintained as a Texinfo manual. If the info and recins programs are properly installed at your site,
the command
info recins
should give you access to the complete manual.
recins 1.4.93 January 2012 RECINS(1)