I tried to parse data from switch configuration files
At first I parse interface number by device name and switch path with this command
Then I tried to get rate limit from interface that I parse from above with this command
But it is showing an error
If $INTERFACE is single number like "74" it will work but if $INTERFACE has forward slash like "1/13" it will showing an error as above. I have tried with put direct interface number and found that I have to put backslash before forward slash in interface number like this
I also tried with awk -v too but no luck. It is showing no error but still can't get value what I want
I tried with every possible changing quote and double quote but still no luck. Can someone help me this?
hi all i am trying to save an awk value into an array in bash:
total=`awk '{sum+=$3} END {print sum}' "$count".txt"`
((count++))
the above statement is in a while loop..
$count is to keep track of file numbers (1.txt,2.txt,3.txt,etc.)
i get the following error:
./lines1:... (1 Reply)
greetings all,
I am have a heck of a time trying to accomplish a very simple thing. I have an array of "shortname<spaces>id" created from a dscl output. I want to assign shortname=word1 and id=word2. I have tried
shortname=$(${textArray} | awk '{print $1}') - and get 'awk : cannot open... (3 Replies)
I would like to create a variable within my bash script using awk. I'm reading in a line from an external file, then outputting to a new file in a specific format. But, it doesnt quite work as I have expected and could use some help.
(A pertinent excerpt of ) the bash code is:
count=1
... (4 Replies)
I'm running a curl command in bash, but the & in the middle causes the second half of the line to run in the background, here's what I'm trying to do:
lat="37.451"
lon="-122.18"
url="http://ws.geonames.org/findNearestAddress?lat=$lat&lng=$lon"
curl -s "$url"
I tried escaping the & with \&,... (4 Replies)
Hi,
I'm trying to populate bash script variable, data_size with the
size of the largest file in my current directory
data_size=$(ls -lS | grep -v "total" | head -1) | awk '{ print $5 }'
I've tried adding an echo before the call to awk
data_size=$(ls -l | grep -v "total" | head -1) |... (2 Replies)
How to store escape character in the variable.
Var=abc,def,ghi,jkl
echo ${Var} | sed -e "s/,/|\\\\./g;s/^/\\\\./g"
\.abc|\.def|\.ghi|\.hjk
Var1=`echo ${Var} | sed -e "s/,/|\\\./g;s/^/\\\./g"`
Actual:
-------
echo $Var1
.abc|.def|.ghi|.jkl
Expected:
---------
echo $Var1... (4 Replies)
Hi everyone,
I'm trying to write a small script to automatize row data treatment. However, I got some trouble with the awk command.
I want to use awk to extract a define paragraph from a text file. The first and final lines are defined externally in two variables called debut and fin.
I... (2 Replies)
Hi,
I am new in bash scripting. In my work, I provide support to several users and when I connect to their computers I use the same admin and password, so I am trying to create a script that will only ask me for the IP address and then connect to the computer without having me to type the user... (5 Replies)
Debian 9 64x - LXDE
How can i disable escape sequences in a variable?
#!/bin/bash
#mainscript
. "./links.bash"
echo "$red_start This text should be red $color_end"#!/bin/bash
#links.bash
#colors
red_start="\eOutput that i get:
\e
Output expected:
This text should be... (5 Replies)
Hello,
I need to split a file into two of different locations by re-direction in awk.
cat infle
aaa 1 3
bbb 2 4
aaa 3 3
bbb 4 4
aaa 5 3
bbb 6 4
cat /storage/tmp/group_a.gtf
aaa 1 3
aaa 3 3
aaa 5 3
cat /storage/tmp/group_b.gtf
bbb 2 4
bbb ... (2 Replies)
Discussion started by: yifangt
2 Replies
LEARN ABOUT DEBIAN
if_vlan
VLAN(4) BSD Kernel Interfaces Manual VLAN(4)NAME
vlan -- IEEE 802.1Q VLAN network interface
SYNOPSIS
To compile this driver into the kernel, place the following lines in your kernel configuration file:
device vlan
Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5):
if_vlan_load="YES"
DESCRIPTION
The vlan driver demultiplexes frames tagged according to the IEEE 802.1Q standard into logical vlan network interfaces, which allows rout-
ing/bridging between multiple VLANs through a single switch trunk port.
Each vlan interface is created at runtime using interface cloning. This is most easily done with the ifconfig(8) create command or using the
cloned_interfaces variable in rc.conf(5).
To function, a vlan interface must be assigned a parent interface and numeric VLAN tag using ifconfig(8). A single parent can be assigned to
multiple vlan interfaces provided they have different tags. The parent interface is likely to be an Ethernet card connected to a properly
configured switch port. The VLAN tag should match one of those set up in the switched network.
Initially vlan assumes the same minimum length for tagged and untagged frames. This mode is selected by the sysctl(8) variable
net.link.vlan.soft_pad set to 0 (default). However, there are network devices that fail to adjust frame length, should it fall below the
allowed minimum due to untagging. Such devices should be able to interoperate with vlan after changing the value of net.link.vlan.soft_pad
to 1. In the latter mode, vlan will pad short frames before tagging them so that their length stays not less than the minimum value after
untagging by the non-compliant devices.
HARDWARE
The vlan driver supports efficient operation over parent interfaces that can provide help in processing VLANs. Such interfaces are automati-
cally recognized by their capabilities. Depending on the level of sophistication found in a physical interface, it may do full VLAN process-
ing or just be able to receive and transmit long frames (up to 1522 bytes including an Ethernet header and FCS). The capabilities may be
user-controlled by the respective parameters to ifconfig(8), vlanhwtag and vlanmtu. However, a physical interface is not obliged to react to
them: It may have either capability enabled permanently without a way to turn it off. The whole issue is very specific to a particular
device and its driver.
By now, the list of physical interfaces able of full VLAN processing in the hardware is limited to the following devices: ae(4), age(4),
alc(4), ale(4), bce(4), bge(4), cxgb(4), em(4), ixgb(4), jme(4), msk(4), nge(4), re(4), sge(4), stge(4), ti(4), txp(4), and vge(4).
The rest of the Ethernet interfaces can run VLANs using software emulation in the vlan driver. However, some of them lack the capability of
transmitting and receiving long frames. Assigning such an interface as the parent to vlan will result in a reduced MTU on the corresponding
vlan interfaces. In the modern Internet, this is likely to cause tcp(4) connectivity problems due to massive, inadequate icmp(4) filtering
that breaks the Path MTU Discovery mechanism.
The following interfaces support long frames for vlan natively: bfe(4), cas(4), dc(4), fwe(4), fxp(4), gem(4), hme(4), le(4), nfe(4), nve(4),
rl(4), sf(4), sis(4), sk(4), ste(4), tl(4), tx(4), vr(4), and xl(4).
The vlan driver automatically recognizes devices that natively support long frames for vlan use and calculates the appropriate frame MTU
based on the capabilities of the parent interface. Some other interfaces not listed above may handle long frames, but they do not advertise
this ability of theirs. The MTU setting on vlan can be corrected manually if used in conjunction with such a parent interface.
SEE ALSO ifconfig(8), sysctl(8)BUGS
No 802.1Q features except VLAN tagging are implemented.
BSD April 14, 2010 BSD