Sponsored Content
Full Discussion: Beginner shell script help
Top Forums Shell Programming and Scripting Beginner shell script help Post 302327390 by durden_tyler on Sunday 21st of June 2009 09:00:09 AM
Old 06-21-2009
Quote:
Originally Posted by harte
...
The thing is there are many many tickers I want to grab data from so would like a list of tickers in testFile.sh that script performs the same action on till completed. Rather then defining each variable and writing the same thing over and over changing s1 to s2 to s3 etc.
...
Code:
$ 
$ for ticker in rimm aapl blah foobar ; do
>   echo "Do your stuff with $ticker..."
> done
Do your stuff with rimm...
Do your stuff with aapl...
Do your stuff with blah...
Do your stuff with foobar...
$ 
$

tyler_durden
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Beginner trying to write a shell script!

Dear All, I'm trying to write a shell script that continously checks a certain folder. When a file is placed in the directory securely copies the file to another server. I've got the secure copying working, but I don't know how to contiously check a directory for a new file and then use that... (3 Replies)
Discussion started by: duncan_glover
3 Replies

2. Shell Programming and Scripting

Shell Script for Beginner

I have a folder with lots of file. e.g. a.txt, b.txt, c.txt.... I want to put these files from the source directory and place them in a destination directory in a specific order, such as /destination/a/a.txt, /destination/b/b.txt, /destination/c/c.txt, ...... Please help. Thx :confused: (3 Replies)
Discussion started by: aaron_fong
3 Replies

3. Shell Programming and Scripting

Debugging a beginner shell script...

I have been following a tutorial on bash which has proven to be very helpful. However, i am stuck with a command not found issue when asking for a y/n response from the user. Below is the part of code I believe is giving me grief... I have been trying to work through this for 3 hours now.... Please... (5 Replies)
Discussion started by: brokepunk
5 Replies

4. Shell Programming and Scripting

Shell script (beginner) need help...

Hello, I'm new to Sheel script and I need your help for a script I need to develop (for me). Indead, I have a software which log all entry from internet and save it in text file. But, the log is practically unreadable because every 256 characters jump to a new line (even if the message is... (5 Replies)
Discussion started by: acidoangel
5 Replies

5. Homework & Coursework Questions

Shell-script loops beginner

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: "Create a shell script that changes the selected word to another word in all files from selected archive. The... (1 Reply)
Discussion started by: oibanuelos
1 Replies

6. Homework & Coursework Questions

Shell Script (beginner)

1. The problem statement, all variables and given/known data: Arguments: http://farm9.staticflickr.com/8070/8212131370_8b6e8c10c5_c.jpg I am given these three arguments. $1, $2, $3 The first argument is the path to a directory. So, how would I go into the directory and compare files? I... (5 Replies)
Discussion started by: spider-man
5 Replies

7. Shell Programming and Scripting

Shell Programming (beginner help)

So guys basically I was really sick and couldn't attend the labs and lectures and I went to my lecture hoping he would say ok I will help you from the start but he just said google it. So If it's possible to make the assignment and explain more in detail why is that would be really helpfull. I can... (1 Reply)
Discussion started by: Joola94
1 Replies

8. Shell Programming and Scripting

C shell - a question of a beginner

Hi, can someone explain how this aliases work: alias m 'if ( \!:$ =~ *gz) set status = 1 && most \!:$ || gzcat \!:1 | most ' I mean, I know what it does, but I don't know how - what is \!:$ and \!:1 - how do it used the && and || - what it does with status variable? thanks (3 Replies)
Discussion started by: tzvikao
3 Replies

9. Shell Programming and Scripting

If condition shell script beginner

Hi all I have the folloing process that needs checking often: ps -ef | grep ih bscsrtx 206 15901 0 11:28:10 pts/6 0:00 fih -r4 bscsrtx 218 15901 0 11:28:27 pts/6 0:01 aih bscsrtx 29763 15901 4 11:27:16 pts/6 0:59 rdh -prih root 429 27268 0 11:30:15 pts/td ... (13 Replies)
Discussion started by: fretagi
13 Replies

10. UNIX for Beginners Questions & Answers

Beginner bash - basic shell script 'while' help...

Hi everyone, first time visitor to these forums here. Keeping a long story short I've been attempting to learn how to code in bash. I have VERY little previous experience with coding languages besides simply copying and pasting batch scripts for Windows. So, with that in mind I've followed a... (4 Replies)
Discussion started by: Meta
4 Replies
Devel::PartialDump(3pm) 				User Contributed Perl Documentation				   Devel::PartialDump(3pm)

NAME
Devel::PartialDump - Partial dumping of data structures, optimized for argument printing. VERSION
version 0.17 SYNOPSIS
use Devel::PartialDump; sub foo { print "foo called with args: " . Devel::PartialDump->new->dump(@_); } use Devel::PartialDump qw(warn); # warn is overloaded to create a concise dump instead of stringifying $some_bad_data warn "this made a boo boo: ", $some_bad_data DESCRIPTION
This module is a data dumper optimized for logging of arbitrary parameters. It attempts to truncate overly verbose data, in a way that is hopefully more useful for diagnostics warnings than warn Dumper(@stuff); Unlike other data dumping modules there are no attempts at correctness or cross referencing, this is only meant to provide a slightly deeper look into the data in question. There is a default recursion limit, and a default truncation of long lists, and the dump is formatted on one line (new lines in strings are escaped), to aid in readability. You can enable it temporarily by importing functions like "warn", "croak" etc to get more informative errors during development, or even use it as: BEGIN { local $@; eval "use Devel::PartialDump qw(...)" } to get DWIM formatting only if it's installed, without introducing a dependency. SAMPLE OUTPUT
"foo" "foo" "foo" => "bar" foo: "bar" "foo => "bar", gorch => [ 1, "bah" ]" foo: "bar", gorch: [ 1, "bah" ] "[ { foo => ["bar"] } ]" [ { foo: ARRAY(0x9b265d0) } ] "[ 1 .. 10 ]" [ 1, 2, 3, 4, 5, 6, ... ] "foo bar" "foo bar" ""foo" . chr(1)" "foox{1}" ATTRIBUTES
max_length The maximum character length of the dump. Anything bigger than this will be truncated. Not defined by default. max_elements The maximum number of elements (array elements or pairs in a hash) to print. Defaults to 6. max_depth The maximum level of recursion. Defaults to 2. stringify Whether or not to let objects stringify themselves, instead of using "StrVal" in overload to avoid side effects. Defaults to false (no overloading). pairs Whether or not to autodetect named args as pairs in the main "dump" function. If this attribute is true, and the top level value list is even sized, and every odd element is not a reference, then it will dumped as pairs instead of a list. EXPORTS
All exports are optional, nothing is exported by default. This module uses Sub::Exporter, so exports can be renamed, curried, etc. warn show show_scalar croak carp confess cluck dump See the various methods for behavior documentation. These methods will use $Devel::PartialDump::default_dumper as the invocant if the first argument is not blessed and "isa" Devel::PartialDump, so they can be used as functions too. Particularly "warn" can be used as a drop in replacement for the built in warn: warn "blah blah: ", $some_data; by importing use Devel::PartialDump qw(warn); $some_data will be have some of it's data dumped. $default_dumper The default dumper object to use for export style calls. Can be assigned to to alter behavior globally. This is generally useful when using the "warn" export as a drop in replacement for "CORE::warn". METHODS
warn @blah A wrapper for "dump" that prints strings plainly. show @blah show_scalar $x Like "warn", but instead of returning the value from "warn" it returns its arguments, so it can be used in the middle of an expression. Note that my $x = show foo(); will actually evaluate "foo" in list context, so if you only want to dump a single element and retain scalar context use my $x = show_scalar foo(); which has a prototype of "$" (as opposed to taking a list). This is similar to the venerable Ingy's fabulous and amazing XXX module. carp croak confess cluck Drop in replacements for Carp exports, that format their arguments like "warn". dump @stuff Returns a one line, human readable, concise dump of @stuff. If called in void context, will "warn" with the dump. Truncates the dump according to "max_length" if specified. dump_as_list $depth, @stuff dump_as_pairs $depth, @stuff Dump @stuff using the various formatting functions. Dump as pairs returns comma delimited pairs with "=>" between the key and the value. Dump as list returns a comma delimited dump of the values. format $depth, $value format_key $depth, $key format_object $depth, $object format_ref $depth, $Ref format_array $depth, $array_ref format_hash $depth, $hash_ref format_undef $depth, undef format_string $depth, $string format_number $depth, $number quote $string The various formatting methods. You can override these to provide a custom format. "format_array" and "format_hash" recurse with "$depth + 1" into "dump_as_list" and "dump_as_pairs" respectively. "format_ref" delegates to "format_array" and "format_hash" and does the "max_depth" tracking. It will simply stringify the ref if the recursion limit has been reached. AUTHOR
XXXX XXX'XX (Yuval Kogman) <nothingmuch@woobling.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2008 by XXXX XXX'XX (Yuval Kogman). This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. CONTRIBUTORS
o David Golden <dagolden@cpan.org> o Florian Ragwitz <rafl@debian.org> o Jesse Luehrs <doy@tozt.net> o Karen Etheridge <ether@cpan.org> o Leo Lapworth <web@web-teams-computer.local> o Steven Lee <stevenwh.lee@gmail.com> perl v5.18.2 2013-11-30 Devel::PartialDump(3pm)
All times are GMT -4. The time now is 05:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy