03-19-2008
Shell script to read file into variable
the script i am trying to write will allow my server to give itself an ip address.
So far i am up to the following but i'm stuck.
tracert -m 1 > traceroute.txt
[Outputs]
1 routername (ipaddr) 2.094 ms 1.789 ms 1.243 ms
i want to get ipaddr as a variable and use it to write the ifcfg-eth script.
How should i go about this?
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 SUSE
ifcfg-bonding
IFCFG-BONDING(5) Network configuration IFCFG-BONDING(5)
NAME
ifcfg-bonding - interface bonding configuration
SYNOPSIS
/etc/sysconfig/network/ifcfg-bond*
Bonding Interfaces
To setup a bonding interface you need a configuration file ifcfg-bond<X> with the usual network settings. But you must add additional vari-
ables
BONDING_MASTER
must be set to 'yes' to identify this interface as a bonding interface
BONDING_SLAVE_<X>
here you specify the interface name representing the slave network interfaces.
BONDING_MODULE_OPTS
contains bonding options. Here you can set interface timeouts or working modes ('mode=active-backup' for backup mode). For addi-
tional information take a look into the documentation mentioned at the bottom. Note, that this options are not passed as parameters
to the bonding kernel module any more, but set via sysfs interface. This variable will be renamed in the feature.
BONDING_SKIP_REMOVE_WORKAROUND
When set to "yes", a bonding interface will be not removed while ifdown any more to avoid problems, e.g. when some third party ker-
nel module, such as Veritas 'llt' module, does not react correctly to the UNREGISTER event and does not remove its references to the
bonding interface causing all network related operation to stuck.
Note: the bonding options are not reverted when this option is enabled and it is required to either explicitly keep the old options
and set them to their default setting on bonding configuration changes or to reboot.
Example
Example for a bonding interface on eth0 and eth1 using the backup mode
ifcfg-bond0
STARTMODE='onboot'
BOOTPROTO='static'
IPADDR='192.168.0.1/24'
BONDING_MASTER='yes'
BONDING_SLAVE_0='eth0'
BONDING_SLAVE_1='eth1'
BONDING_MODULE_OPTS='mode=active-backup miimon=100'
Additional Information
For additional and more general information take a look into /usr/src/linux/Documentation/networking/bonding.txt. Maybe you need to
install the kernel sources to get this additional documentation.
The configuration of routes for this kind of interface does not differ from ordinary interfaces. See man routes for details.
BUGS
Please report bugs at <http://www.suse.de/feedback>
AUTHOR
Christian Zoz <zoz@suse.de> -- ifup script
Wilken Gottwalt <wgottwalt@suse.de> -- ifcfg-bonding manual page
SEE ALSO
ifcfg(5), ifup(8).
sysconfig April 2005 IFCFG-BONDING(5)