Sponsored Content
Full Discussion: Struck at shell command
Top Forums Shell Programming and Scripting Struck at shell command Post 302959764 by Aia on Thursday 5th of November 2015 09:44:06 PM
Old 11-05-2015
Code:
[buzzme]$ awk '/yahoo\.com/ && NF==2 {print $1}' RS= buzzme.file
user=alexander
user=paul
user=mike

[buzzme]$ awk '/yahoo\.com/ && NF>2 {print $1}' RS= buzzme.file
user=natasha
user=bipasha

---------- Post updated at 07:44 PM ---------- Previous update was at 06:56 PM ----------

Code:
perl -00 -alne '
    /yahoo\.com/ and push @{$yahoo{scalar @F == 2}}, $F[0];
    END{ print "Yahoo Only:\n", join "\n", @{$yahoo{1}};
         print "Yahoo Plus:\n", join "\n", @{$yahoo{$undef}};
    }
' buzzme.file

Code:
Yahoo Only:
user=alexander
user=paul
user=mike

Yahoo Plus:
user=natasha
user=bipasha

This User Gave Thanks to Aia For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to use more than one MPE command STREAM with Unix command in a single shell?

Hello, I have problem in writing the shell script involving MPE command STREAM related to HP-UX and Unix command. Script is sh "nlshCMD 'STREAM <job name1>' | 'SHOWJOB' | grep $HPJOBNUM" sh "nlshCMD 'STREAM <job name2>' | 'SHOWJOB' | grep $HPJOBNUM" sh "nlshCMD 'STREAM <job name3>' |... (0 Replies)
Discussion started by: bosskr
0 Replies

2. HP-UX

How to use more than one MPE command STREAM with Unix command in a single shell?

Hello, I have problem in writing the shell script involving MPE command STREAM related to HP-UX and Unix command. Script is sh "nlshCMD 'STREAM <job name1>' | 'SHOWJOB' | grep $HPJOBNUM" sh "nlshCMD 'STREAM <job name2>' | 'SHOWJOB' | grep $HPJOBNUM" sh "nlshCMD 'STREAM <job name3>' |... (1 Reply)
Discussion started by: bosskr
1 Replies

3. Shell Programming and Scripting

Awking!! Printing decimal output is struck

Hi friends, I have a small problem with AWK. I am not able to print decimal values! :confused: below is my code: #! /bin/awk -f awk BEGIN{printf("%d",123)}; -> This prints the integer properly. x=111 awk BEGIN{printf("%d",x)}; -> This doesnt print! :( Please help me solve this. It... (4 Replies)
Discussion started by: divzz
4 Replies

4. Shell Programming and Scripting

Need to Write Shell Script based off of this shell command

I'm trying to read a bunch of log files and output the lines that contain particular strings. To accomplish this, I've been running the following from the command line: find . -name "*" | xargs grep " " | grep " " > output.txt Two grep statements are needed in case I'm looking for a... (3 Replies)
Discussion started by: Rally_Point
3 Replies

5. Shell Programming and Scripting

can anyone help with shell script command about searching word with grep command?

i want to search in the current directory all the files that contain one word for example "hello" i want to achieve it with the grep command but not with the grep * (2 Replies)
Discussion started by: aintour
2 Replies

6. Shell Programming and Scripting

Struck with Typeset Command

Can someone explain whats this below command will do exactly.. typeset tmpFile1 tmpDir1 rc fileName fullName bc typeset tmpFile1 tmpFile2 rc fileSuffix uef typeset origFile bc fullName tmpDir1 remoteCmd inFile newInFile typeset num fn curDate fileSuffix ucFileName Since i'm new to... (1 Reply)
Discussion started by: help_scr_seeker
1 Replies

7. Shell Programming and Scripting

Any shell or hack that makes the shell command line take vi commands?

basically i'm tired of hitting the left arrow a few dozen times when correcting a mistake or modifying a history command i'd like to use vim style key shortcuts while on the command line so that a 55 moves the cursor 55 places to the left... and i want all the other vi goodies, search of... (3 Replies)
Discussion started by: marqul
3 Replies

8. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

9. UNIX Desktop Questions & Answers

command to run another shell on top of your default shell?

Can someone point me to the right command to to run another shell on top of your default shell? Thanks PS If admin sees this It is not home work. I am old man who wants to learn unix in my spare time. I CURRENTLY DO NOT GO SCHOOL, COLLEGE OR UNIVERSITY. (2 Replies)
Discussion started by: Bill Thompson
2 Replies

10. UNIX for Dummies Questions & Answers

Shell script not working but command works in command prompt

Hi everyone I have a problem with my script If I try directly this command /usr/bin/nice -n 19 mysqldump -u root --password="******" wiki_schneider -c | nice -n 19 gzip -9 > /point_de_montage/$(date '+%Y%m%d')-wiki-db.sql.gz It works But if I simply add this command in a script and... (8 Replies)
Discussion started by: picemma
8 Replies
Finance::Quote::Yahoo::Australia(3pm)			User Contributed Perl Documentation		     Finance::Quote::Yahoo::Australia(3pm)

NAME
Finance::Quote::Yahoo::Australia - Fetch Australian stock quotes via Yahoo. SYNOPSIS
use Finance::Quote; my $q = Finance::Quote->new; my %info = $q->fetch("yahoo_australia","BHP"); # Use this module only. my %info = $q->fetch("australia","BHP"); # Failover with other methods. DESCRIPTION
This module allows information to be fetched from Yahoo abouts stocks traded on the Australian Stock Exchange. Information about indexes (such as the All Ordinaries) are not available through this module, although if information is requested from the "australia" source then these will automatically failover to direct queries from the Australian Stock Exchange. This module is loaded by default on a Finance::Quote object, although it can be explicitly loaded by passing the argument "Yahoo::Australia" to Finance::Quote->new(). This module provides both the "australia" and "yahoo_australia" fetch methods. You should use the "australia" method if you wish to allow failovers to other sources, and "yahoo_australia" if you only want to obtain quotes from this module. Information obtained via this module is governed by Yahoo's terms and conditions, see http://au.finance.yahoo.com/ for more details. LABELS RETURNED
This module returns all the standard labels (where available) provided by Yahoo, as well as the currency label. See Finance::Quote::Yahoo::Base for more information. SEE ALSO
Yahoo Australia, http://au.finance.yahoo.com/ Finance::Quote::Yahoo::Base perl v5.14.2 2014-03-03 Finance::Quote::Yahoo::Australia(3pm)
All times are GMT -4. The time now is 01:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy