Sponsored Content
Top Forums Shell Programming and Scripting Creating menu list from configuration file Post 95372 by zazzybob on Tuesday 10th of January 2006 07:04:34 PM
Old 01-10-2006
Anyway... stripping this problem down to the basics - play with IFS....
Code:
# cat ./layers.conf
Database Layer
RiGHTv Adminstration Layer
RTE Subscribers Layer
Quit
# cat ./layers.sh
#!/bin/ksh
oldIFS="${IFS}"
IFS="
"
select foo in $(<layers.conf); do
IFS="${oldIFS}"
done
exit 0
# ./layers.sh
1) Database Layer                       3) RTE Subscribers Layer
2) RiGHTv Adminstration Layer           4) Quit

Cheers
ZB
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating a menu for recycling and permanently deleting files.

Trying to alias rm to move files to a hidden trash directory in the bash shell. I've tried to create this alias numberous ways and it's just not working. Here's what I've tried, anyone have any suggestions. alias rm='mv $* ~/.trash' alias rm= 'mv$* ~/.trash' things like that... I've also... (2 Replies)
Discussion started by: strmy_ngts
2 Replies

2. Shell Programming and Scripting

Creating User Accounts from a list in file

I have a file that contains a list of names. I need a loop that creates user accounts to all the names in the list where username = names in file password = username Another question: how can i validate that a particular var is of 6 characters length I need an if statement that will... (8 Replies)
Discussion started by: Laila Saif
8 Replies

3. UNIX for Dummies Questions & Answers

creating a file with a list

I would like to create a text file that contains the list (names of files and dirs) of a particular directory... any ideas ? (5 Replies)
Discussion started by: hinman
5 Replies

4. Shell Programming and Scripting

Creating a menu within a script file

I am very new to Unix and know the basic commands. I have to write a script file and I'm completely lost. The script file is to show the following at the beginning: Menu of Options 1. Display all files in a user's home directory. 2. Welcome yourself to the program. 3. Display System... (8 Replies)
Discussion started by: sinjin
8 Replies

5. Shell Programming and Scripting

Creating a menu from find

Hi I am wanting to create a menu that will list all the log files in a specific directory such as /apps/logs. So it would be something like this: #!/bin/ksh print 'Select The Required Log File' PS3='log? ' select choice in <this is to contain a list of files that are in a directory that... (3 Replies)
Discussion started by: markrj
3 Replies

6. Shell Programming and Scripting

Creating a menu

Hi, I need your help co create a very small menu somthing that look like this: 1. first step 2. second step 3. last step from step : ___ to step : ___ If the user choose 1 --> it will echo : Hellow If the user choose 2 --> it will echo : World If the user choose 3 --> it will echo... (4 Replies)
Discussion started by: yoavbe
4 Replies

7. Shell Programming and Scripting

ls > file - Creating file containing the list of all files present in a directory

Hi All, I need to create a file which contains the list of all the files present in that directory. e.g., ls /export/home/user/*.dat > list_file.dat but what i am getting is: $ ls /export/home/user/*.dat > list_file.dat /export/home/user/*.dat: No such file or directory But I have... (1 Reply)
Discussion started by: pranavagarwal
1 Replies

8. Shell Programming and Scripting

Need help creating a menu.

Hi Master of masters, Thanks for ur reply. Need ur help for following. Is it possible to create menu for following in linux or a function. > Look in logs > Status > Action > End Action > CONFSUCCESS > Success > Show message as successful > Enter to continue > CONFFAIL > Failure > Show... (1 Reply)
Discussion started by: rajeshwebspere
1 Replies

9. Shell Programming and Scripting

Creating bash script to process a data file based on the menu

Hey, im fairly new to unix and Im trying to make this unix project that would display a menu and do the following. MENU =========================== (p, P) Print users info (a, A) Add new user (s, S) Search user (d, D) Delete user (x,X) Exit Enter your choice: Trying to... (3 Replies)
Discussion started by: ultimaxtrd
3 Replies
PPI::Normal(3)						User Contributed Perl Documentation					    PPI::Normal(3)

NAME
PPI::Normal - Normalize Perl Documents DESCRIPTION Perl Documents, as created by PPI, are typically filled with all sorts of mess such as whitespace and comments and other things that don't effect the actual meaning of the code. In addition, because there is more than one way to do most things, and the syntax of Perl itself is quite flexible, there are many ways in which the "same" code can look quite different. PPI::Normal attempts to resolve this by providing a variety of mechanisms and algorithms to "normalize" Perl Documents, and determine a sort of base form for them (although this base form will be a memory structure, and not something that can be turned back into Perl source code). The process itself is quite complex, and so for convenience and extensibility it has been separated into a number of layers. At a later point, it will be possible to write Plugin classes to insert additional normalization steps into the various different layers. In addition, you can choose to do the normalization only as deep as a particular layer, depending on aggressively you want the normalization process to be. METHODS
register $function => $layer, ... The "register" method is used by normalization method providers to tell the normalization engines which functions need to be run, and in which layer they apply. Provide a set of key/value pairs, where the key is the full name of the function (in string form), and the value is the layer (see description of the layers above) in which it should be run. Returns true if all functions are registered, or "undef" on error. new my $level_1 = PPI::Normal->new; my $level_2 = PPI::Normal->new(2); Creates a new normalization object, to which Document objects can be passed to be normalized. Of course, what you probably REALLY want is just to call PPI::Document's "normalize" method. Takes an optional single parameter of the normalisation layer to use, which at this time can be either "1" or "2". Returns a new "PPI::Normal" object, or "undef" on error. layer The "layer" accessor returns the normalisation layer of the object. process The "process" method takes anything that can be converted to a PPI::Document (object, SCALAR ref, filename), loads it and applies the normalisation process to the document. Returns a PPI::Document::Normalized object, or "undef" on error. NOTES
The following normalisation layers are implemented. When writing plugins, you should register each transformation function with the appropriate layer. Layer 1 - Insignificant Data Removal The basic step common to all normalization, layer 1 scans through the Document and removes all whitespace, comments, POD, and anything else that returns false for its "significant" method. It also checks each Element and removes known-useless sub-element metadata such as the Element's physical position in the file. Layer 2 - Significant Element Removal After the removal of the insignificant data, Layer 2 removed larger, more complex, and superficially "significant" elements, that can be removed for the purposes of normalisation. Examples from this layer include pragmas, now-useless statement separators (since the PDOM tree is holding statement elements), and several other minor bits and pieces. Layer 3 - TO BE COMPLETED This version of the forward-port of the Perl::Compare functionality to the 0.900+ API of PPI only implements Layer 1 and 2 at this time. TO DO
- Write the other 4-5 layers :) SUPPORT
See the support section in the main module. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2005 - 2011 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.16.2 2011-02-25 PPI::Normal(3)
All times are GMT -4. The time now is 11:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy