12-04-2017
Thanks Rudy!
Worked like a charm
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to do a substitution: CPF to ,C,P,F, CPM to ,C,P,M, SPF to ,S,P,F etc. I can do each of them with separate substitutions e.g. s/CPF/,C,P,F/ but I'd like to know if there is a more elegant solution. In general, how can I use the results of the search in the substitution, ... (3 Replies)
Discussion started by: wvdeijk
3 Replies
2. Shell Programming and Scripting
Is there a way to simplify stating 1 through to 10, for example in a for loop construct?
for x in 1 2 3 4 5 6 7 8 9 10
do
....
done
I have tried (1-10) with no luck.. thanks (2 Replies)
Discussion started by: sirtrancealot
2 Replies
3. Shell Programming and Scripting
tcpdump -nr testdump|awk '!/:/;gsub(/^+|+$/,""){print $3};a!~$0;{a=$0};{print $3};!/length/;/./;!/11\:/;!/8 7 6 5 4 3 2 1/;!/UDP/{b=$0} END {for (j=i-1; j>=0; ) print b };{for (i=NF; i>0; i--) printf("%s ",i);printf ("\n")}'
*NOTE IN j>=0 the ; ) was given a space since a smiley is showing up...... (1 Reply)
Discussion started by: sil
1 Replies
4. Shell Programming and Scripting
my script:
FILE="$1"
echo "You Entered $FILE"
if ; then
tmp=$(cat $FILE | sed '/./!d' | sed -n '/regex/,/regex/{/regex/d;p}'| sed -n '/---/,+2!p' | sed -n '/#/!p' | sed 's/^*//' | sed -e\
s/*:// | sed -n '/==> /!p' | sed -n '/--> /!p' | sed -n '/regex/,+1!p' | sed -n '/======/!p' | sed -n... (1 Reply)
Discussion started by: omgsomuchppl
1 Replies
5. UNIX for Advanced & Expert Users
Hi,
Is there a way to simplify the below script? Because I am having problems executing this if I added this to CRON. Also, you may notice that its objective is to put all information in one file (rm1.txt). And in addition file "sRMR_6.txt" to sRMR_23.txt" changes its information everyday.... (4 Replies)
Discussion started by: vibora
4 Replies
6. Shell Programming and Scripting
Hello,
I have a large number of sed commands that I execute one after the other, simply because I don't know if there's a shorter way to do it. I hope someone can help me save some time :-)
These are my commands:
1.) remove all " in the file:
sed -e 's/\"//g' file
2.) insert ( and... (3 Replies)
Discussion started by: Bloomy
3 Replies
7. Shell Programming and Scripting
the code below is a small fragment of the actual line, in fact i have about 20 values i'm comparing and want to know if it can be simplified. other than the x.xx.xx format of the value they have nothing in common
if || || ; then
do this
else
do this
fiany suggestions? (6 Replies)
Discussion started by: crimso
6 Replies
8. Shell Programming and Scripting
Hi all, I don't have much experience with shell scripting and I was wondering if there's a shorter way to write this.
Basically, given a list of strings separated by new lines, I want to prepend each string with a prefix and separate the strings with commas
i.e.
stra
strb
strc
becomes... (3 Replies)
Discussion started by: vshan
3 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I want to submit my awk script into cluster queue as my job takes about forty minutes to finish so I can not run it on the main node.
My awk script is like the following and I have three files. so, I write :
qsub -q short.q Myscript.awk file1 file2 file3
It submits the work into... (1 Reply)
Discussion started by: Homa
1 Replies
10. UNIX for Beginners Questions & Answers
I have the following script:
awk -F "," '{ if ( $4 > 450 && $4 < 550 && $5 > 0.5 ) print $2, $5; else print $2, "0" }' test.txt | awk '{a+=$2}END{for(i in a){print i, a}}' | sort -nk 1.2 | sed 1,2d
and a bunch of files that look like the test file attached here.
I am outputting all... (2 Replies)
Discussion started by: Xterra
2 Replies
LEARN ABOUT CENTOS
biosdevname
BIOSDEVNAME(1) General Commands Manual BIOSDEVNAME(1)
NAME
biosdevname - give BIOS-given name of a device
SYNOPSIS
biosdevname [options] [args]...
DESCRIPTION
biosdevname takes a kernel device name as an argument, and returns the BIOS-given name it "should" be.
OPTIONS
-i, --interface
Treat [args] as ethernet devs
-d, --debug
Enable debugging
-p, --policy [physical|all_ethN]
-P, --prefix [string]
string use for embedded NICs in the physical policy (default=em)
-x, --nopirq
Do not use $PIR table for mapping PCI device to slot. Some BIOS have incorrect values.
-s, --smbios [x.y]
Require minimum SMBIOS version x.y
POLICIES
The physical policy is the current default. However, when invoking biosdevname in udev rules, one should always specify the policy you
want, as the default has changed over time.
The physical policy uses the following scheme:
em<port>[_<virtual instance>]
for embedded NICs
p<slot>p<port>[_<virtual instance>]
for cards in PCI slots
The all_ethN policy makes a best guess at what the device order should be, with embedded devices first, PCI cards in ascending slot
order, and ports in ascending PCI bus/device/function order breadth-first. However, this policy does not work if your PCI devices
are hot-plugged or hot-pluggable, including the virtual functions on an SR-IOV device. In a hot-plug scenario, each separate udev
instance will be invoked in parallel, while the device tree is still being populated with new devices. Each udev instance will see
a different PCI tree, and thus cannot provide consistent enumeration. Use of this policy should be limited to only scenarios where
all PCI devices are present at boot (cold-plug).
EXIT CODES
Returns 0 on success, with BIOS-suggested name printed to stdout.
Returns 1 on provided device name lookup failure.
Returns 2 if system BIOS does not provide naming information. biosdevname requires system BIOS to provide naming information, either via
SMBIOS or sysfs files.
Returns 3 if not run as root but requires root privileges.
Returns 4 if running in a virtual machine.
SEE ALSO
http://linux.dell.com/wiki/index.php/Oss/libnetdevname
http://linux.dell.com/files/biosdevname/
git://linux.dell.com/biosdevname.git
RELATED PROGRAMS
The dmidecode package contains two tools useful for debugging BIOS features that biosdevname uses, specifically dmidecode to read the
SMBIOS Type 9 and Type 41 tables, and biosdecode to read the PCI IRQ Routing Table. Please include the output of each of these programs in
any bug reports.
AUTHOR
biosdevname was written by Matt Domsch <Matt_Domsch@dell.com>
This manual page was written by Rudy Gevaert <Rudy.Gevaert@UGent.be>, for the Debian project (but may be used by others).
Nov 28, 2010 BIOSDEVNAME(1)