Search Results

Search: Posts Made By: phamp008
10,673
Posted By phamp008
awk to findstr equivalent
Hi,

I 'd like to translate this command from awk to findstr on Windows DOS

FILE:

str1 server1 a
str1 server2 a
str2 server1 b
str2 server2 b

Awk command:
awk ' $1 ~/str1/ {...
33,095
Posted By phamp008
syntax error as follow: awk: syntax error...
syntax error as follow:

awk: syntax error near line 1
awk: bailing out near line 1


Probably typo error

command as follow:

awk ' $1 ~ HOSTNAME { print $2 } ' HOSTNAME="${HOSTNAME}" text1
33,095
Posted By phamp008
Thank you all. I am trying to run awk in...
Thank you all.

I am trying to run awk in finish script after jumpstart installation on Solaris 10 X86.
The boot image during jumpstart does not have awk in /usr/xpg4.

And it doesn't work if I...
33,095
Posted By phamp008
awk syntax for Solaris
Hi,

Pass variable in SUN SOLARIS awk

I have a file call text

server1 10.0.0.2

When i use this awk command in Mac OS and Linux , everything works as expected.

export...
4,837
Posted By phamp008
Thank you very much to all , awk array is a...
Thank you very much to all , awk array is a power tool.
4,837
Posted By phamp008
awk counting number of occurences
Hi,

I am trying to count the max number of occurences of field1 in my apache log

example:

10.0.0.1 field2 field3
10.0.0.2 filed2 field3
10.0.0.1 field2 field3
10.0.0.1 field2 field3
...
14,812
Posted By phamp008
Thanks that works well May I ask where can...
Thanks that works well

May I ask where can read on reference for

f{$0 = "#" $0} ?
14,812
Posted By phamp008
using awk to comment out lines to the end of file
Hello,

I have a file as follow

a
b
c
c
d
d
e


I would like to write a awk command to insert # from the first occurence of
"c" to the end of the files.
OUTPUT should be like this
...
1,603
Posted By phamp008
thanks
thanks
1,603
Posted By phamp008
Regular Expression help
Hi,

Example

^www\.[^.]+\.host\.com$

I would like to know what the bold parts means.

thanks
5,918
Posted By phamp008
Thanks! for loop does solve the issue.
Thanks!

for loop does solve the issue.
5,918
Posted By phamp008
read line and ssh
Hi,

I 'd like have a script to ssh to a list of hosts from a file name hosts_list. However, the script seem to exit out from the first line of the file

#!/bin/bash
X="hosts_list";

while...
19,640
Posted By phamp008
thank you much
thank you much
2,388
Posted By phamp008
bash awk codes to perl
Hi,

I am interesting in writing the following bash codes into perl

My script is simple take field 2 in /etc/passwd and put into an array

#!/bin/bash
PASSWD_FILE=/etc/passwd
A=(`awk -F: ' {...
19,640
Posted By phamp008
bash:awk output into an array
Hi,

I have a file

1:apple orange:one
2:banana:two
3:cherry:3

When I do awk -F: ' { print $2 } ' file

apple orange
banana
cherry

Now, when i redirect awk output to the file it has...
1,319
Posted By phamp008
I got the answer to this question awk -F:...
I got the answer to this question

awk -F: '$1~/username/ { x=$0 ; next ; } ($1~/pass_expir/) && ($2 > 3 ) { printf x"\n" $0"\n" ;}' file
1,319
Posted By phamp008
awk help
Hello,

I have a file format like this

username: user1
pass_expir: 3
username: user2
pass_expir: 4
username: user3
pass_expir: 0

I 'd like to use awk to print out username and...
3,696
Posted By phamp008
Hi, We found something on google, and it...
Hi,

We found something on google, and it works

df -kP | awk ' BEGIN { FS="[ %\t]+" ; } { print $5 ; } '
3,696
Posted By phamp008
Hi, I am expecting the output to eliminate...
Hi,

I am expecting the output to eliminate %. That's why I place % as one of my field separator.

Thanks for the input though.
3,696
Posted By phamp008
awk with mulitple FS
Hi,

I would like to get 5th field from this output using FS[ %].

Filesystem 1024-blocks Used Available Capacity Mounted on
172.29.138.222:/vol/vol0 311936256 2565248 309371008 ...
5,827
Posted By phamp008
awk with more than one FS
I have a passwd file

user:me31oe0ZEh:100:100: user name ++user@domain.com:/export/user:/bin/bash

to get the 6field and awk again with email address.

current command

awk -F":" ' { print...
4,669
Posted By phamp008
thank you much, this exactly what I need.
thank you much, this exactly what I need.
4,669
Posted By phamp008
actually, I want the output appear like this: ...
actually, I want the output appear like this:

a:work:apple1
b:baby:banana2
c:candy:cat3

Thanks
4,669
Posted By phamp008
thank you for your quick post. I was wondering...
thank you for your quick post. I was wondering if this can be done with awk ?
4,669
Posted By phamp008
match field between 2 files
I would like to do the following in bash shell.

file a

a:1
b:2
c:3

file b

a:work:apple
b:baby:banana
c:candy:cat
d:desk:dog

I would like to match field 1 in file a to file b, if...
Showing results 1 to 25 of 37

 
All times are GMT -4. The time now is 12:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy