Search Results

Search: Posts Made By: Sara_84
2,768
Posted By Scott
Just saying it isn't working isn't exactly...
Just saying it isn't working isn't exactly helpful.

If the output of bppllist -byclient client1, 2, 3, 4, etc. is:

policy1
policy2
policy3
policy4
...


Then the following command (to...
2,768
Posted By pravin27
Could this help ? for i in $(cat clients_list) ...
Could this help ?
for i in $(cat clients_list)
do
bppllist -byclient client1 | awk '/^CLASS/{print $2}' | while read policy
do
bpplclients $policy -delete $i
done
done
5,638
Posted By MadeInGermany
All sed versions take $ sed '1i\ NAME ID\ ...
All sed versions take
$ sed '1i\
NAME ID\
' textAll but certain (old) GNU sed.
5,638
Posted By hanson44
$ uname Linux $ sed "1i NAME ID\n" text ...
$ uname
Linux
$ sed "1i NAME ID\n" text
NAME ID

mick 3424
noah 134
samuel 787
jack 434
5,638
Posted By Yoda
Or use printf and cat { printf "NAME\tID\n\n";...
Or use printf and cat
{ printf "NAME\tID\n\n"; cat inputfile; } > outputfile
5,638
Posted By mjf
awk 'BEGIN {print "NAME ID"} {print $0}'...
awk 'BEGIN {print "NAME ID"} {print $0}' input.file
NAME ID
mick 3424
noah 134
samuel 787
jack 434


You can add \n after ID if you need an extra line after the header.
4,839
Posted By hanson44
It's not awk, but here is a convenient way to do...
It's not awk, but here is a convenient way to do it:
$ paste -d , -s file
34,12,56,76,88

---------- Post updated at 02:28 AM ---------- Previous update was at 02:21 AM ----------

Best I can...
2,002
Posted By ahamed101
Check vgersh99 post in...
Check vgersh99 post in https://www.unix.com/shell-programming-scripting/220037-passing-value-variable-read-command-line-called-script.html

You can also try echo 1 | yourscript

--ahamed
1,290
Posted By Jotne
Another awk awk '/Gender/...
Another awk
awk '/Gender/ {g=$NF;getline;i=$NF;getline;getline;print i,g,$4}' file
4512 m 04/23/2012
1256 m 012/10/2011
14523 F 01/20/2009
1,290
Posted By guruprasadpr
Use NF-1 in-place of NF: awk...
Use NF-1 in-place of NF:

awk '/Gender/{g=$NF}/ID/{id=$NF}/[Hh]ire/{print id,g,$(NF-1)}' file

Guru.
3,549
Posted By balajesuri
while read nm dt; do [ "$dt" == "$(date -d...
while read nm dt; do [ "$dt" == "$(date -d "last-monday" +"%m/%d/%Y")" -o "$dt" == "$(date -d "last-tuesday" +"%m/%d/%Y")" ] && echo $nm; done < employee_list
3,549
Posted By Jotne
awk '$2==d1 || $2==d2 {print$1}' d1="$(date...
awk '$2==d1 || $2==d2 {print$1}' d1="$(date +"%m/%d/%Y" -d last-monday)" d2="$(date +"%m/%d/%Y" -d last-tuesday)" employee_list
Jack
Maneul
Eric
3,549
Posted By Scrutinizer
The date is a string, so in awk there would need...
The date is a string, so in awk there would need to be double quotes around them if you want to compare it do $2. Although that would work, it would be better to use awk variables (for example...
36,853
Posted By zaxxon
For AIX: List your HBAs: lsdev...
For AIX:

List your HBAs:

lsdev -Ccadapter -l fcs*


Print the WWN:

lscfg -vl fcs0


You should be able to identify which is the WWN; have no output here at the moment.
You can cut the...
1,019
Posted By Don Cragun
Here are a couple of ways to do what you want: ...
Here are a couple of ways to do what you want:
#!/bin/ksh
echo simplififed translation from given code
while read i
do grep $i /tmp/b | awk '{printf("echo mail -s \"%s is your new ID\"...
1,104
Posted By rangarasan
awk
What about in sed?
Anyway try this,

awk '/^48/{t=1;next;}t==1 && $0 !~ /^[0-9]/{print;}/^[0-9]/{t=0;}' file

Cheers,
Ranga:-)
4,360
Posted By balajesuri
sed -i "s/^ *//g" inputfile or perl -i -pe...
sed -i "s/^ *//g" inputfile
or
perl -i -pe 's/^\s+//g' inputfile

There should be lots of threads on this one. Did you try searching the forum?
1,733
Posted By itkamaraj
$ nawk '/2011/ , /2012/ {if($0!~/[0-9]/){print}}'...
$ nawk '/2011/ , /2012/ {if($0!~/[0-9]/){print}}' mylist.txt | tr " " "\n"
sara
phill
mike
bob
tala
ali
zula
1,733
Posted By itkamaraj
$ nawk '/2011/ , /2012/ {if($0!~/[0-9]/){print}}'...
$ nawk '/2011/ , /2012/ {if($0!~/[0-9]/){print}}' mylist.txt
sara phill mike bob
tala ali zula
1,431
Posted By michaelrozar17
You can try -r alpha@domain.com along with the...
You can try -r alpha@domain.com along with the mail command. But check in your man page as different OS would have their own meanings.
1,990
Posted By agama
If the list of clients is long, or the client...
If the list of clients is long, or the client 'name' contains blanks, this would be a better way to read through the list. Also if the output of bpplclients is long the same applies. The grep isn't...
1,990
Posted By codemaniac
Hello , You want to do something like that ....
Hello ,
You want to do something like that . huh?
for CLIENT in $(cat clientlist)
do
for POLICY in $(bppllist -byclient $CLIENT | grep "CLASS " | awk '{print $2}')
do
...
2,057
Posted By rangarasan
awk
Hi,

Try this one,


awk '/^sport/{a[p]++;}/^Month/{gsub(/Month *: */,"");p=$0;a[p]="0";}END{for ( i in a){print i,a[i];}}' Input_File


Cheers,
Ranga:)
2,057
Posted By Scrutinizer
Try: awk '/Month/{m=$NF;A[m]=-1} {A[m]++}...
Try:
awk '/Month/{m=$NF;A[m]=-1} {A[m]++} END{for(i in A)print i,A[i]}' infile | sort -rnk2
awk '/Month/{if(NR>1)print m,c; m=$NF; c=-1}{c++} END{print m,c}' infile | sort -rnk2
1,760
Posted By ygemici
# awk '!/NAME/{a[$1]++};END{for(i in a)print...
# awk '!/NAME/{a[$1]++};END{for(i in a)print i,a[i]}' mylist|sort -nrk2
Mike 3
Sara 2
Raya 1
Micheal 1
Fibi 1
Showing results 1 to 25 of 38

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