Sponsored Content
Full Discussion: Running external script
Top Forums Shell Programming and Scripting Running external script Post 302340046 by kshji on Sunday 2nd of August 2009 05:15:14 AM
Old 08-02-2009
Quote:
Originally Posted by cfajohnson
cfajohnson eval is nice
.
Also read is answer = run once and parse.
Generic version:
Code:
read h m s <<EOF
$(date '+%H %M %S')
EOF

Ksh can do also:
Code:
date '+%H %M %S' | read h m s

Array is also nice method, if you have list of values
Code:
values=(   $(date '+%H %M %S')  )
# ${values[0]} is 1st value
# ${#values[*]} number of values

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Return info from a called external script

New to Unix scripting and have written two scripts, one calling the other. When it returns to the calling script is it possible to return information, like a return code? :confused: (1 Reply)
Discussion started by: cathrop
1 Replies

2. Shell Programming and Scripting

Possible to call external script?

Hi Is it possible to have a bash script call an external bash script? For instance, I have a series of monitor scripts that check for running services (such as httpd, postmaster). Each monitor script is individual to the service. If a service fails, I would like to have a larger script that goes... (3 Replies)
Discussion started by: mikie
3 Replies

3. Shell Programming and Scripting

querry ..including external shell script

is there any way to include one shell script into other like include in c apart from putting it in a function (3 Replies)
Discussion started by: mobydick
3 Replies

4. Shell Programming and Scripting

importing functions from an external bash script

Hi all, I'm trying to import some functions I have saved in a file named functions.sh into a different script (protocol.sh). Can anybody show me how to do this? I tried source functions.sh as I would do at the terminal but source command cannot be found from within the script protocol.sh. ... (2 Replies)
Discussion started by: tevang
2 Replies

5. Shell Programming and Scripting

Getting category when given the variable from external file to shell script

Hi, I have a script that interacts with a config file in the format: file1.txt file2.txt file3.txt file4.txt file5.txt file6.txt I would like to return the Category, when given the file name. (11 Replies)
Discussion started by: MoreCowbell
11 Replies

6. Shell Programming and Scripting

passing arguments to external script

Hi! I have a python script that requires arguments and these arguments are file paths. This script works fine when executed like this: /my_python_script "file_path1" "file_path2" (i added quotes as some file names may have weird characters) the issue happens when i launch my python script... (14 Replies)
Discussion started by: gigagigosu
14 Replies

7. Web Development

cgi script and external UNIX commands (like swadm)

Hi, I am trying to implement a server monitoring dashboard using cgi scripting. I am planning to run the necessary unix scripts from the web page using cgi. This method works fine for standard unix commands but I am unable to run some external unix commands (like swadm show_processes, swadm... (9 Replies)
Discussion started by: jofinjoseph
9 Replies

8. Shell Programming and Scripting

Running external programs inside an if then else

Good morning, First time poster. be gentle! :) I do not know coding all that well but I can hack the hell out of example scripts! I just cant wrap my brain around this one. Im trying to run two grep statements in the first IF statement and doing an AND between them. Something is going... (6 Replies)
Discussion started by: mrplow2k69
6 Replies

9. Shell Programming and Scripting

How to run the Shell Script from external directory using java?

Hi, I have created a Shell Script and invoke through java using Process Builder It's working fine, if (Shell script file ) in the same directory as java file. By Problem: How to run the Shell Script file( resides in external directory) using java. What configuration i have... (1 Reply)
Discussion started by: nanthagopal
1 Replies

10. Shell Programming and Scripting

awk - saving results of external script to variable.

So, I've been playing with speeding up some analysis we do by using multiple threads of awk (actually, mawk, but code-compatible as far as I use it) on multiple CPU cores. So, I have a big data file and I have several copies of exactly the same processor script, written in mawk. I also have a... (8 Replies)
Discussion started by: treesloth
8 Replies
Finance::QuoteHist::MSN(3pm)				User Contributed Perl Documentation			      Finance::QuoteHist::MSN(3pm)

NAME
Finance::QuoteHist::MSN - Site-specific class for retrieving historical stock quotes. SYNOPSIS
use Finance::QuoteHist::MSN; $q = Finance::QuoteHist::MSN->new ( symbols => [qw(IBM UPS AMZN)], start_date => '01/01/1999', end_date => 'today', ); foreach $row ($q->quotes()) { ($symbol, $date, $open, $high, $low, $close, $volume) = @$row; ... } DESCRIPTION
Finance::QuoteHist::MSN is a subclass of Finance::QuoteHist::Generic, specifically tailored to read historical quotes from the MSN financial web site (http://moneycentral.msn.com/). Note that Quotemedia is currently the site that provides historical quote data for such other sites as Silicon Investor, which was the target of a module in an earlier release of this distribution. MSN does not currently provide information on dividends or splits. Please see Finance::QuoteHist::Generic(3) for more details on usage and available methods. If you just want to get historical quotes and are not interested in the details of how it is done, check out Finance::QuoteHist(3). METHODS
The basic user interface consists of a single method, as shown in the example above. That method is: quotes() Returns a list of rows (or a reference to an array containing those rows, if in scalar context). Each row contains the Symbol, Date, Open, High, Low, Close, and Volume for that date. Quote values are pre-adjusted for this site. REQUIRES
Finance::QuoteHist::Generic DISCLAIMER
The data returned from these modules is in no way guaranteed, nor are the developers responsible in any way for how this data (or lack thereof) is used. The interface is based on URLs and page layouts that might change at any time. Even though these modules are designed to be adaptive under these circumstances, they will at some point probably be unable to retrieve data unless fixed or provided with new parameters. Furthermore, the data from these web sites is usually not even guaranteed by the web sites themselves, and oftentimes is acquired elsewhere. Details for MSN's terms of use can be found here: http://privacy2.msn.com/tou/en-us/default.aspx If you still have concerns, then use another site-specific historical quote instance, or none at all. Above all, play nice. AUTHOR
Matthew P. Sisk, <sisk@mojotoad.com> COPYRIGHT
Copyright (c) 2006 Matthew P. Sisk. All rights reserved. All wrongs revenged. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Finance::QuoteHist::Generic(3), Finance::QuoteHist(3), perl(1). perl v5.12.4 2010-06-06 Finance::QuoteHist::MSN(3pm)
All times are GMT -4. The time now is 01:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy