03-19-2008
i am using this in the script
traceroute -m1 ipaddr |grep 10.12 |awk '{ print $3}'| tr -d '(' | tr -d ')' | read ipaddr
echo $ipaddr
the only problem now is that it wont run as a single command.
ipaddr=$ ( traceroute -m1 10.0.100.1 |grep 10.12 |awk '{ print $3}'| tr -d '(' | tr -d ')' )
tracert.sh: line 3: syntax error near unexpected token `|'
tracert.sh: line 3: `ipaddr=( traceroute -m 1 10.100.0.100 |grep 10.12 |awk '{print $3}'| tr -d '(' | tr -d ')' )'
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a 1-line file which looks like " First second third 4 five". I need to extract the number (here 4) in that line and put it in a variable. I will use the variable later to make few tests in my C shell script.
Can somebody help me? (2 Replies)
Discussion started by: haouesse
2 Replies
2. Shell Programming and Scripting
Solaris 10
Korn shell ksh,
Hi there,
I have figured out to get yesterday's date which is using the below command:
TZ=GMT+24; date +%d-%b-%Y to get the format of 30-Sep-2008 and
TZ=GMT+24; date +%Y%m%d to get the format of 20080930.
I need this two format. In my perl script below I need... (4 Replies)
Discussion started by: bulkbiz
4 Replies
3. Shell Programming and Scripting
Hi all,
I am new to shell scripting.
I have dbf file and I need to convert it into csv file.
OR, can i read the fields from a .dbf file and OR seprate the records in dbf file and put into .csv or txt.
Actually in the .dbf files I am getting , the numbers of fields may vary in very record and... (6 Replies)
Discussion started by: gauara
6 Replies
4. Shell Programming and Scripting
Hi all,
I want write a csh script which must be able:
1.read a file
2.assign value in file as variable
and can i use read in csh script?
thx (2 Replies)
Discussion started by: proghack
2 Replies
5. Shell Programming and Scripting
I need to read a text file that contain columns of data, i need to read 1st column as a function to call, and others are the data i need to get into a ksh script.
I am quite new to ksh scripting, i am not very sure how to read each row line by line and the data in each columns of that line, set... (3 Replies)
Discussion started by: gavin_L
3 Replies
6. Shell Programming and Scripting
hi all,
i have to read a file using shell script for example my csv file is
like this
Tid Inputfille Inputfilepath
1 ABC_20141218.idr /export/home/him60t1/input
2 ABC_20141219.idr /export/home/him60t1/input1
what i have to do is if on my command line i... (1 Reply)
Discussion started by: ramsavi
1 Replies
7. Shell Programming and Scripting
hi,
i have a text file which conatins some fields delimited by space. some fields contains * as entries.
cron_file.txt
0 * * * *
0 3 * * *
i want to read each line 1 by 1 and store each field in seperate variables n a shell script.
i am unable to read the field that contains a *. how... (3 Replies)
Discussion started by: Little
3 Replies
8. Shell Programming and Scripting
Input are file and file1
file contains
store.bal
product.bal
category.bal
admin.bal
file1 contains
flip.store.bal ::FFFF:BADC:CD28,::FFFF:558E:11C5,6,8,2,1,::FFFF:81C8:CA8B,::FFFF:BADC:CD28,1,0,0,0,::FFFF:81C8:11C5,2,1,0,0,::FFFF:81DC:3111,1,0,1,0
store.bal.... (2 Replies)
Discussion started by: veeruasu
2 Replies
9. Shell Programming and Scripting
Hello,
I have a simple script that runs an application,
# these arguments have the same value for all splits
ARCH=12.11.1
BATCHES=50
EPOCHS=5000
LEARN_MODE=ONLINE
LEARN_RATE=0.25
PROJ=02_BT_12.11.1.proj
echo "processing split A on hex"
cd A/
DATA_SET=S2A_v1_12.1.1_1... (4 Replies)
Discussion started by: LMHmedchem
4 Replies
10. UNIX for Dummies Questions & Answers
sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies
LEARN ABOUT CENTOS
rlm_ippool_tool
RLM_IPPOOL_TOOL(8) System Manager's Manual RLM_IPPOOL_TOOL(8)
NAME
rlm_ippool_tool - dump the contents of the FreeRadius ippool database files
SYNOPSIS
If an ipaddress is specified then that address is used to limit the actions or output.
rlm_ippool_tool [-a] [-c] [-o] [-v] session-db index-db [ipaddress]
Mark the entry nasIP/nasPort as having ipaddress
rlm_ippool_tool -n session-db index-db ipaddress nasIP nasPort
Update old format database to new.
rlm_ippool_tool -u session-db new-session-db
DESCRIPTION
rlm_ippool_tool dumps the contents of the FreeRADIUS ippool databases for analyses or for removal of active (stuck?) entries.
Or with the -n argument adds a usage entry to the FreeRADIUS ippool databases.
OPTIONS
-a Print all active entries.
-c Report number of active entries.
-r Remove active entries.
-v Verbose report of all entries.
-o Assume old database format (nas/port pair, not md5 output).
-n Mark the entry nasIP/nasPort as having ipaddress.
-u Update old format database to new.
EXAMPLES
Given the syntax in the FreeRadius radiusd.conf:
ippool myippool {
range-start = 192.0.2.0
range-stop = 192.0.2.255
[...]
session-db = ${raddbdir}/ip-pool.db
ip-index = ${raddbdir}/ip-index.db
}
To see the number of active entries in this pool, use:
$ rlm_ippool_tool -c ip-pool.db ip-index.db
13
To see all active entries in this pool, use:
$ rlm_ippool_tool -a ip-pool.db ip-index.db
192.0.2.5
192.0.2.82
192.0.2.244
192.0.2.57
192.0.2.120
192.0.2.27
[...]
To see all information about the active entries in the use, use:
$ rlm_ippool_tool -av ip-pool.db ip-index.db
NAS:172.16.1.1 port:0x2e8 - ipaddr:192.0.2.5 active:1 cli:0 num:1
NAS:172.16.1.1 port:0x17c - ipaddr:192.0.2.82 active:1 cli:0 num:1
NAS:172.16.1.1 port:0x106 - ipaddr:192.0.2.244 active:1 cli:0 num:1
NAS:172.16.1.1 port:0x157 - ipaddr:192.0.2.57 active:1 cli:0 num:1
NAS:172.16.1.1 port:0x2d8 - ipaddr:192.0.2.120 active:1 cli:0 num:1
NAS:172.16.1.1 port:0x162 - ipaddr:192.0.2.27 active:1 cli:0 num:1
[...]
To see only information of one entry, use:
$ rlm_ippool_tool -v ip-pool.db ip-index.db 192.0.2.1
NAS:172.16.1.1 port:0x90 - ipaddr:192.0.2.1 active:0 cli:0 num:0
To add an IP address usage entry, use:
$ rlm_ippool_tool -n ip-pool.db ip-index.db 192.0.0.1 172.16.1.1 0x90
rlm_ippool_tool: Allocating ip to nas/port: 172.16.1.1/144
rlm_ippool_tool: num: 1
rlm_ippool_tool: Allocated ip 192.0.2.1 to client on nas 172.16.1.1,port 144
SEE ALSO
radiusd(8)
AUTHORS
Currently part of the FreeRADIUS Project (http://www.freeradius.org) Originally by Edwin Groothuis, edwin@mavetju.org
(http://www.mavetju.org)
Mailing list details are at http://www.freeradius.org/
RLM_IPPOOL_TOOL(8)