So I am back again beating my head against the wall with a shell script and getting a headache! I want to change each year in a file (1980, 1981, 1982, 1983, etc.) to the same year followed by a tab.
The input is "blah blah (1980) blah blah".
I want to get "blah blah (1980 ) blah blah".
only changes the last year. Does sed need something special with foreach?
Thanks much to anyone in advance, Peggy
Last edited by bakunin; 01-23-2009 at 08:04 PM..
Reason: added code-tags. Please use them when posting code
Hello, I am new at this forum so please bare with me on this.
Within a given directory, I have a list of files in which in each file, I would like to do a substitution. I would like to substitute the string mlcl to mll in each file using the foreach command. I dont quite get how to do that. If... (7 Replies)
Hi Guys,
I have a loop which uses a wildcard
i.e. foreach f (*)
but when I execute the tcsh file in unix then it gives me an error
->>>>>>>foreach: words not parenthesized<<<<<<<<<<-
Any help. (1 Reply)
In a foreach loop, is it possible for the loop to go through 2 arguments instead of one
i.e. instead of foreach i (do stuff for i), we have foreach i j(do stuff for i; do stuff for j)
I am working under BASH and TCSH shell environments
cheers (3 Replies)
Hi everyone
Does anyone know what is wrong with this script. i keep getting errors
foreach filename (`cat testing1`)
set string=$filename
set depth=`echo "$string"
echo $depth
end
the error is the following
testing: line 1: syntax error near unexpected token `('
testing: line 1:... (3 Replies)
Hi All,
Is there any problem with the below 'foreach' loop?
foreach risk_factor ($(cat "$rf_list"))
where "rf_list=$SCRIPT/Utility/rflist.txt "
I'm wondering, it is throwing below error message:
syntax error at line 34: `(' unexpected
Any idea/suggestions ?
Thanks in advance /... (7 Replies)
I am trying to make a script for my Counter-Strike: Source servers. What i am wanting it to do is for it to restart each server, the only way i can think of doing this in through for each.
Years what i have at the moment.
server_start() {
START=`ps x | grep SCREEN | grep $SRV | cut -d '?' -f... (5 Replies)
Dear all,
I wrote a script to download files and move files in directories according to their name.
Now here is the problem:
Both p101 and p360 data download successfully, but when I move them according to the year and month, only p101 data can be placed at the right location, p360,... (1 Reply)
Hi everyone I'm new to unix and encountered a small problem i couldnt find out a reason why it doesn't work..please help..
in my csh script when i tried to use the foreach loop like this:
foreach x ( ls )
echo $x
end
when i tried to run it, it printed out 'ls' to the std out instead of... (3 Replies)
I need to put together a script that will take the contents of two different files (database name and database owner) and put them in two variables within a line:
foreach x (`cat /local/hd3/dba/tools/build_db_scripts/dbs`)
foreach z (`cat /local/hd3/dba/tools/build_db_scripts/dbas`)... (6 Replies)
Discussion started by: deneuve01
6 Replies
LEARN ABOUT DEBIAN
radiusd.conf
radiusd.conf(5) FreeRADIUS configuration file radiusd.conf(5)NAME
radiusd.conf - configuration file for the FreeRADIUS server
DESCRIPTION
The radiusd.conf file resides in the radius database directory, by default /etc/raddb. It defines the global configuration for the FreeRA-
DIUS RADIUS server.
CONTENTS
There are a large number of configuration parameters for the server. Most are documented in the file itself as comments. This page docu-
ments only the format of the file. Please read the radiusd.conf file itself for more information.
The configuration file parser is independent of the server configuration. This means that you can put almost anything into the configura-
tion file. So long as it is properly formatted, the server will start.
When the server parses the configuration file, it looks only for those configurations it understands. Extra configuration items are
ignored. This "feature" can be (ab)used in certain interesting ways.
FILE FORMAT
The file format is line-based, like many other Unix configuration files. Each entry in the file must be placed on a line by itself,
although continuations are supported.
The file consists of configuration items (variable = value pairs), sections, and comments.
Variables
Variables can be set via:
name = value
Single and double-quoted strings are permitted:
string1 = "hello world"
string2 = 'hello mom'
Sections
A section begins with a section name, followed on the same line by an open bracket '{'. Section may contain other sections, com-
ments, or variables. Sections may be nested to any depth, limited only by available memory. A section ends with a close bracket
'}', on a line by itself.
section {
...
}
Sections can sometimes have a second name following the first one. The situations where this is legal depend on the context. See
the examples and comments in the radiusd.conf file for more information.
section foo {
...
}
Comments
Any line beginning with a (#) is deemed to be a comment, and is ignored. Comments can appear after a variable or section defini-
tions.
# comment
foo = bar # set variable 'foo' to value 'bar'
section { # start of section
...
} # end of section
Continuations
Long lines can be broken up via continuations, using '' as the last character of the line. For example, the following entry:
foo = "blah
blah
blah"
will set the value of the variable "foo" to "blah blah blah". Any CR or LF is not turned into a space, but all other whitespace is
preserved in the final value.
REFERENCES
The value of a variable can reference another variable. These references are evaluated when the configuration file is loaded, which means
that there is no run-time cost associated with them. This feature is most useful for turning long, repeated pieces of text into short
ones.
Variables are referenced by ${variable_name}, as in the following examples.
foo = bar # set variable 'foo' to value 'bar'
who = ${foo} # sets variable 'who' to value of variable 'foo'
my = "${foo} a" # sets variable 'my' to "bar a"
If the variable exists in a section or subsection, it can be referenced as ${section.subsection.variable}. Forward references are not
allowed. Relative references are allowed, by pre-pending the name with one or more period.
blogs = ${.foo}
Will set variable blogs to the value of variable foo, from the current section.
blogs = ${..foo}
Will set variable blogs to the value of variable foo, from the section which contains the current section.
blogs = ${modules.detail.detailfile}
Will set variable blogs to the value of variable detailfile, of the detail module, which is in the modules section of the configuration
file.
FILES
/etc/raddb/radiusd.conf
SEE ALSO radiusd(8)unlang(5)AUTHOR
Alan DeKok <aland@freeradius.org>
12 Jun 2007 radiusd.conf(5)