Sponsored Content
Top Forums Shell Programming and Scripting Building a dynamic UNIX menu with input files Post 302983045 by rdrtx1 on Wednesday 5th of October 2016 07:32:10 PM
Old 10-05-2016
Code:
#!/bin/bash

while [ -z "${ans[0]}" ]
do
  awk -F'|' '{print NR ") get password for " $1 " on " $2}' input.txt
  read -p "Choose Option Number: " sel
  ans=($(awk -F'|' 'NR==sel {print $1, $2}' sel="$sel" input.txt))
done
cat pass_${ans[0]}_${ans[1]}.txt

This User Gave Thanks to rdrtx1 For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Dynamic select with multiple word menu items

Hello all, I'm developing a deployment script at work and at one point it would need to display something like this: Which version of ADMIN would you like to deploy? 1) 1.0.0 (store1, 10 Jan 2004) 2) 1.0.1 (store1, 20 Jun 2004) 3) 1.0.2 (store1, 15 Jul 2004) Select a version : I know... (5 Replies)
Discussion started by: domivv
5 Replies

2. UNIX for Advanced & Expert Users

building flat files in unix and importing them from windows

what is a flat file in unix? i have to import a unix flat files from windows based programme. my question is not to export from unix but only to import from windows only. how to build that flat files? how to create export to windows how to import from windows (3 Replies)
Discussion started by: tunirayavarapu
3 Replies

3. Shell Programming and Scripting

dynamic Select menu

Hi all is menu driven by SELECT can be a dynamic ? My requirement is that i want SELECT to be created on run time not predefine . The select should be created as per the no of words in a file thanks in advance rawat (2 Replies)
Discussion started by: rawatds
2 Replies

4. Shell Programming and Scripting

Dynamic Menu Help

I'm working on a menu to read folders in as menu selections then CD to the selected folder and display the contained files as menu selections for execution. I'm using the following to read in the file list but I get lost after that. I only read in files that begin with CAPs. The problem is... (3 Replies)
Discussion started by: ScottKe
3 Replies

5. Shell Programming and Scripting

building output file from multiple input files

Hi there, I am trying to figure out a way to combine multiple sources with different data on a single file, and I am trying to find the best way to do it. I have multiple files, let's say A, B, C and D. A has a field in common with B, B has a field in common with C, and C has a field in... (2 Replies)
Discussion started by: ppucci
2 Replies

6. Shell Programming and Scripting

Assigning values to reference variables for a dynamic menu driven script.

How do I assign values to reference variables? I am assigning a variable name to --> $user_var Then I am trying to change its underlying variable value by $((user_var))=$user_value .. its failing,, Please let me know if there is a way to do this dynamically.. FileA.props... (5 Replies)
Discussion started by: kchinnam
5 Replies

7. Web Development

Dynamic Drop Down Menu

I need to create a dynamic drop down menu which is populated by entries such as; htdocs/client1/index.php htdocs/client2/index.php htdocs/client3/index.php htdocs/client4/index.php etc. So htdocs/client*/index.php Is this possible? I know how to do this using normal arrays, but not... (2 Replies)
Discussion started by: JayC89
2 Replies

8. Shell Programming and Scripting

Creating Dynamic Input or daa files

Hi, I got a requirement to automate the process. We have SLA files, there are some 80 SLA files comes from 1.30pm - 5.30pm. I was asked to write a script to check for the SLA files in the load directory, if the files come then we got to send the mail to the group, if the mails doesnt come... (1 Reply)
Discussion started by: afahmed
1 Replies

9. UNIX for Dummies Questions & Answers

Dynamic menu selection? Help..

Hi guys, i would like to create a program that allow user to show the information of certain thing such as network card. I would like the menu to be dynamic, for example: my computer system have 2 network card inserted at the moment, therefore the menu will have 2 choice for the user. eth0... (12 Replies)
Discussion started by: malfolozy
12 Replies
DPGEN_FIFO(3)						  Alliance - genlib User's Manual					     DPGEN_FIFO(3)

NAME
DPGEN_FIFO - FIFO Macro-Generator SYNOPSIS
#include <genlib.h> void GENLIB_MACRO (DPGEN_FIFO, char *modelname, long flags, long N); DESCRIPTION
Generate a FIFO of regNumber words of N bits named modelname. How it works : o datain0 and datain1 : the two write busses. Only one is used to actually write the FIFO, it is selected by the sel signal. o sel : when set to '0' the datain0 is used to write the register word, otherwise it will be datain1. o r, rok : set r when a word is requested, rok tells that a word has effectively been popped (rok == not empty). o w, wok : set w when a word is pushed, wok tells that the word has effectively been pushed (wok == not full). TERMINAL NAMES 1. ck : clock signal (input, 1 bit). 2. reset : reset signal (input, 1 bit). 3. r : read requested (input, 1 bits). 4. w : write requested (input, 1 bits). 5. rok : read acknowledge (output, 1 bits). 6. wok : write acknowledge (output, 1 bits). 7. sel : select the write bus (input, 1 bit). 8. datain0 : first write bus (input, N bits). 9. datain1 : second write bus (input, N bits). 10. dataout : read bus (output, N bits). 11. vdd : power. 12. vss : ground. EXAMPLE
GENLIB_MACRO(DPGEN_RF1, "model_fifox8_32" , F_BEHAV|F_PLACE , 32 /* Words size. */ , 8 /* Number of words. */ ); GENLIB_LOINS( "model_fifox8_32" , "instance1_fifo1_32" , "ck" , "r" , "w" , "rok" , "wok" , "sel" , "datain0[31:0]" , "datain1[31:0]" , "dataout[31:0]" , "vdd", "vss", NULL ); SEE ALSO
GENLIB_MACRO(3), genlib(1) ASIM
/LIP6 30 July 2004 DPGEN_FIFO(3)
All times are GMT -4. The time now is 06:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy