Sponsored Content
Top Forums Shell Programming and Scripting Need assistance with simple shell script to organize files. [Code attached] Post 302371520 by ryandamartini on Sunday 15th of November 2009 11:19:22 AM
Old 11-15-2009
Thank You sir!

I appreciate it, this is due Monday night for class and has stumped me. I was proud of it with having only a lousy powerpoint file to work with.

Thanks Smilie
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need a little assistance with a shell script

I need to modify a script to send an attatched file. I have researched and read the faq's but have not found a solution for my script. Here is a copy of the code I am using: #!/bin/sh mysqldump --opt --skip-add-locks --user=****** --password=******* databasename | gzip >... (3 Replies)
Discussion started by: rickou812
3 Replies

2. Shell Programming and Scripting

shell script assistance please

When I run this command (showstatus <username> <dbname>) in the prompt, the following will be displayed in the screen: 1. Show processes 2. Start process 3. Stop process 4. Go back to prompt Once i choose/type Option "1" (which is Show processes), it will display the list of processes... (5 Replies)
Discussion started by: xinoo
5 Replies

3. Shell Programming and Scripting

looking for a simple way to organize envs on our unix box...

would like to standardize how we set envs on our unix box, so I thought a menu would be a great way to accomplish this. The problem I'm experiencing, is the value is set...but ONLY during the time the menu is initiated. please see below: > /home/is/bin/r12MENU.sh ... (2 Replies)
Discussion started by: mr_manny
2 Replies

4. Shell Programming and Scripting

Shell Script Assistance

I am looking for a shell script or command to automate a process of opening many files in a directory and changing a string of text. Example: I have a apache web server that uses virtual hosting. There are approximately 2300 vhost entries or files. So in the directory... (2 Replies)
Discussion started by: jaysunn
2 Replies

5. Shell Programming and Scripting

Need assistance with a simple script

I have a simple script. Do you know what I got this error? ./total_memory.ksh: line 5: ' Thanks #! /bin/bash setmem=30177660 totalMemory= grep MemTotal /proc/meminfo | awk '{print $2}' if ; then echo "Total memory $totalMemory is less than :$setmem" exit 1 ... (3 Replies)
Discussion started by: Beginer0705
3 Replies

6. UNIX and Linux Applications

Organize (pretty) code

I'm looking for terminal programs, which organize and pretty code like HTML or JavaScript. Thanks! ---------- Post updated at 07:01 AM ---------- Previous update was at 01:49 AM ---------- Found this Online javascript beautifier (1 Reply)
Discussion started by: borobudur
1 Replies

7. Shell Programming and Scripting

Assistance with an awk code to split files but keep the header

---------- Post updated at 11:48 AM ---------- Previous update was at 11:46 AM ---------- Hello all I have an awk code that successfully creates separate text files based on the first six letters of the second field. What it doesn't do is preserve the header into each resulting file. ... (6 Replies)
Discussion started by: colecandoo
6 Replies

8. Shell Programming and Scripting

Seeking assistance in Shell script

#!/bin/bash >error_log for s in `cat s.txt` do uptime $s >>error_log echo $s >>error_log done The above code produce output with server name and its uptime in 2 different lines .My requirement is to have the same in one line . Please assist (3 Replies)
Discussion started by: vinil
3 Replies

9. Shell Programming and Scripting

Shell script assistance Urgent

write a script using shift and case to receive 11 argument and do the following --arg1 - print hello message and the current proccess id --arg2 - read and edit a file based on the value which came along with the arg2. --arg3 - validate whether all... (1 Reply)
Discussion started by: saku
1 Replies
Template::Plugin::Cycle(3pm)				User Contributed Perl Documentation			      Template::Plugin::Cycle(3pm)

NAME
Template::Plugin::Cycle - Cyclically insert into a Template from a sequence of values SYNOPSIS
[% USE cycle('row', 'altrow') %] <table border="1"> <tr class="[% class %]"> <td>First row</td> </tr> <tr class="[% class %]"> <td>Second row</td> </tr> <tr class="[% class %]"> <td>Third row</td> </tr> </table> ################################################################### # Alternatively, you might want to make it available to all templates # throughout an entire application. use Template::Plugin::Cycle; # Create a Cycle object and set some values my $Cycle = Template::Plugin::Cycle->new; $Cycle->init('normalrow', 'alternaterow'); # Bind the Cycle object into the Template $Template->process( 'tablepage.html', class => $Cycle ); ####################################################### # Later that night in a Template <table border="1"> <tr class="[% class %]"> <td>First row</td> </tr> <tr class="[% class %]"> <td>Second row</td> </tr> <tr class="[% class %]"> <td>Third row</td> </tr> </table> [% class.reset %] <table border="1"> <tr class="[% class %]"> <td>Another first row</td> </tr> </table> ####################################################### # Which of course produces <table border="1"> <tr class="normalrow"> <td>First row</td> </tr> <tr class="alternaterow"> <td>Second row</td> </tr> <tr class="normalrow"> <td>Third row</td> </tr> </table> <table border="1"> <tr class="normalrow"> <td>Another first row</td> </tr> </table> DESCRIPTION
Sometimes, apparently almost exclusively when doing alternating table row backgrounds, you need to print an alternating, cycling, set of values into a template. Template::Plugin::Cycle is a small, simple, and hopefully DWIM solution to these sorts of tasks. It can be used either as a normal Template::Plugin, or can be created directly and passed in as a template argument, so that you can set up situations where it is implicitly available in every page. METHODS
new [ $Context ] [, @list ] The "new" constructor creates and returns a new "Template::Plugin::Cycle" object. It can be optionally passed an initial set of values to cycle through. When called from within a Template, the new constructor will be passed the current Template::Context as the first argument. This will be ignored. By doing this, you can use it both directly, AND from inside a Template. init @list If you need to set the values for a new empty object, of change the values to cycle through for an existing object, they can be passed to the "init" method. The method always returns the '' null string, to avoid inserting anything into the template. elements The "elements" method returns the number of items currently set for the "Template::Plugin::Cycle" object. list The "list" method returns the current list of values for the "Template::Plugin::Cycle" object. This is also the prefered method for getting access to a value at a particular position within the list of items being cycled to. [%# Access a variety of things from the list %] The first item in the Cycle object is [% cycle.list.first %]. The second item in the Cycle object is [% cycle.list.[1] %]. The last item in the Cycle object is [% cycle.list.last %]. next The "next" method returns the next value from the Cycle. If the end of the list of valuese is reached, it will "cycle" back the first object again. This method is also the one called when the object is stringified. That is, when it appears on its own in a template. Thus, you can do something like the following. <!-- An example of alternate row classes in a table--> <table border="1"> <!-- Explicitly access the next class in the cycle --> <tr class="[% rowclass.next %]"> <td>First row</td> </tr> <!-- This has the same effect --> <tr class="[% rowclass %]"> <td>Second row</td> </tr> </table> value The "value" method is an analogy for the "next" method. reset If a single "Template::Plugin::Cycle" object is to be used it multiple places within a template, and it is important that the same value be first every time, then the "reset" method can be used. The "reset" method resets the Cycle, so that the next value returned will be the first value in the Cycle object. SUPPORT
Bugs should be submitted via the CPAN bug tracker, located at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Template-Plugin-Cycle <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Template-Plugin-Cycle> For other issues, or commercial enhancement or support, contact the author.. AUTHOR
Adam Kennedy <adamk@cpan.org> Thank you to Phase N Australia (http://phase-n.com/ <http://phase-n.com/>) for permitting the open sourcing and release of this distribution as a spin-off from a commercial project. COPYRIGHT
Copyright 2004 - 2008 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.12.4 2008-06-19 Template::Plugin::Cycle(3pm)
All times are GMT -4. The time now is 06:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy