10-25-2007
you had mentioned it as 4th column and making use of $6 in awk command.
Typo ?
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi All,
a bit of a weird one here. I'm trying to pass a variable into an awk command, and I keep getting an error.
I have the line
nawk -F"," -v red=$random_variable '{print $red}' $w_dir/$file_name > $w_dir/${column_name}
that keeps failing with the error
nawk: can't open file {print... (17 Replies)
Discussion started by: Khoomfire
17 Replies
2. Shell Programming and Scripting
my desired output is like this:
so the thing is, I only need to show every of this part out
but the frequency of that data is not fixed, so sometimes it may have 4 lines, or 6 lines or whatever in that file. However, the last line will always have empty space/line below it. (13 Replies)
Discussion started by: finalight
13 Replies
3. Shell Programming and Scripting
Hi,
I am not sure what I am doing wrong but I am messing up some logic here. The input file is something like this:
*___String Type A Here___String Type B Here___123
*___ ___String Type B Here___123
*___ ___String Type B Here___123
*___ ... (6 Replies)
Discussion started by: Legend986
6 Replies
4. Shell Programming and Scripting
hi,
i am having three files which is having following data
file1:
field1 field2 field3
1 A B
2 C D
3 E F
file2:
4 G H
1 I J
5 K L
file3:
4 M N (3 Replies)
Discussion started by: angel12345
3 Replies
5. Shell Programming and Scripting
Hi Experts
I am facing a weird issue while using print statement in awk. I have a text file with 3 fields shown below:
# cat f1
234,abc,1000
235,efg,2000
236,jih,3000
#
When I print the third column alone, I dont face any issue as shown below:
# awk '{print $3 }' FS=, f1
1000
2000... (5 Replies)
Discussion started by: guruprasadpr
5 Replies
6. Shell Programming and Scripting
awk 'BEGIN{print 1.2.3.4}'
1.20.30.4
Can anyone explain why has extra "0" in the IP address? (3 Replies)
Discussion started by: newoz
3 Replies
7. Emergency UNIX and Linux Support
Hi,
my file has the data like below:
11,231,ABCVAV
22,AAHJHAj22,hdsjkhdls
22,dhskjhdkshd
22,gdgkdkadh
11,232,dgsjgdjh
22,ghdskahdkja
22,shdkajshs
11,233,ddjs
22,dhjkahkd
22,hsajhaah
11,231,sjkjsjj
22,ahkh
22,hsakh
From the above i need only the records which starts as 11,231... (5 Replies)
Discussion started by: pandeesh
5 Replies
8. Shell Programming and Scripting
VARA='hello|welcome|gone|fantastic|superb|nicecar'
if VARA contains a pipe "|", i want the contents of VARA to be tranformed to:
VARA="(hello) (welcome) (gone) (fantastic) (superb) (nicecar)"
so that, when i echo the contents of $VARA like this:
echo "$VARA"
or like this:
print... (8 Replies)
Discussion started by: SkySmart
8 Replies
9. Shell Programming and Scripting
Hi,
I have a simple awk script:
BEGIN{}
{
$a=$2-$1;
print $a
}
END{if(NR==0){
print "0"
}
}
to which I provide the following input
2.9 14
22.2 27 (4 Replies)
Discussion started by: jamie_123
4 Replies
10. Shell Programming and Scripting
Here is the awk code i wrote :
if ; then
gawk -v field_position="$field_position" -v field_length="$field_length" -v header="$header" -v trailer="$trailer" -v lr="$lr" '{
if(NR==1&&header=="1")
{
next
}
if(NR==lr&&trailer=="1")
{
next
}... (1 Reply)
Discussion started by: ysvsr1
1 Replies
LEARN ABOUT FREEBSD
color.4th
COLOR.4TH(8) BSD System Manager's Manual COLOR.4TH(8)
NAME
color.4th -- FreeBSD color-detection boot module
DESCRIPTION
The file that goes by the name of color.4th is a set of commands designed to simplify color logic. The commands of color.4th by themselves
are not enough for most uses. Please refer to the examples below for the most common situations, and to loader(8) for additional commands.
Before using any of the commands provided in color.4th, it must be included through the command:
include color.4th
This line is present in /boot/loader.4th file, so it is not needed (and should not be re-issued) in a normal setup.
The commands provided by it are:
loader_color? Returns FALSE if the loader_color environment variable is set to ``NO'' (case-insensitive) or ``0''. Otherwise
returns TRUE (unless booting serial).
The environment variables that effect its behavior are:
loader_color
If set to ``NO'' (case-insensitive) or ``0'', causes loader_color? to return FALSE, indicating to many modules that color
should not be used.
FILES
/boot/loader The loader(8).
/boot/color.4th color.4th itself.
/boot/loader.rc loader(8) bootstrapping script.
EXAMPLES
Standard i386 /boot/loader.rc:
Use color where applicable:
loader_color="YES"
SEE ALSO
loader.conf(5), loader(8), loader.4th(8)
HISTORY
The color.4th set of commands first appeared in FreeBSD 9.0.
AUTHORS
The color.4th set of commands was written by Devin Teske <dteske@FreeBSD.org>.
BSD
August 6, 2013 BSD