Sponsored Content
Top Forums Shell Programming and Scripting Bash to select panel then specific file in directory Post 302967541 by cmccabe on Wednesday 24th of February 2016 04:25:23 PM
Old 02-24-2016
The user prompt is executed and if "y" is entered then the menu function is called.

Code:
while true; do
    read -p "Do you want to get coverage of a specific panel?" yn
    case $yn in
        [Yy]* ) menu; break;;
        [Nn]* ) exit;;
        * ) echo "Please answer yes or no.";;
    esac
done

Code:
menu() {
    while true
    do
        printf "\n please make a selection from the MENU \n
        ==================================
        \t 1  Incidental Findings     
  ==================================\n\n"
        printf "\t Your choice: "; read menu_choice

        case "$menu_choice" in
        1) incidental ;; select file1 in $(cd /user/file/data;ls);do break;done
            ......... (whatever command to execute)
        *) printf "\n Invalid choice."; sleep 2 ;;
        esac
    done
}

So if the "incidental" is selected after the ;; is where to add select file1 in $(cd /user/file/data;ls);do break;done ? Thank you Smilie

Last edited by cmccabe; 02-24-2016 at 05:25 PM.. Reason: fixed format
 

10 More Discussions You Might Find Interesting

1. Solaris

Limit bash/sh user's access to a specific directory

Hello Team, I have Solaris 10 u6 I have a user test1 using bash that belong to the group staff. I would like to restrict this user to navigate only in his home directory and his subfolders but not not move out to other directories. How can I do it ? Thanks in advance (1 Reply)
Discussion started by: csierra
1 Replies

2. Shell Programming and Scripting

Rename specific file extension in directory with match to another file in bash

I have a specific set (all ending with .bam) of downloaded files in a directory /home/cmccabe/Desktop/NGS/API/2-15-2016. What I am trying to do is use a match to $2 in name to rename the downloaded files. To make things a more involved the date of the folder is unique and in the header of name... (1 Reply)
Discussion started by: cmccabe
1 Replies

3. Shell Programming and Scripting

Bash to select and save file in new directory

I am trying to select a file in bash and save it to a directory. The below does run but no selected file is saved. Thank you :). bash # select file printf "please select a file to analyze with entered gene or genes \n" select file in $(cd... (4 Replies)
Discussion started by: cmccabe
4 Replies

4. Shell Programming and Scripting

Bash to select oldest folder in directory automatically and log process

The `bash` below uses the oldest folder in the specified directory and logs it. The goes though an analysis process and creates a log. My problem is that if there are 3 folders in the directory folder1,folder2,folder3, the bash is using folder2 for the analysis eventhough folder1 is the oldest... (0 Replies)
Discussion started by: cmccabe
0 Replies

5. Shell Programming and Scripting

Bash to select text and apply it to a selected file in bash

In the bash below I am asking the user for a panel and reading that into bed. Then asking the user for a file and reading that into file1.Is the grep in bold the correct way to apply the selected panel to the file? I am getting a syntax error. Thank you :) ... (4 Replies)
Discussion started by: cmccabe
4 Replies

6. UNIX for Beginners Questions & Answers

Using grep to select specific patterns in text file?

How do I use grep to select words that start with I or O, end in box, and contain at least one letter in between them? the text file mailinfo.txt contains Inbox the Inbox Is a match box Doesn't match INBOX Outbox Outbox1 InbOX Ibox I box If the command works correctly it... (4 Replies)
Discussion started by: steezuschrist96
4 Replies

7. Shell Programming and Scripting

Bash to list all folders in a specific directory

The below bash is trying to list the folders in a specific directory. It seems close but adds the path to the filename, which basename could strip off I think, but not sure why it writes the text file created? This list of folders in the directory will be used later, but needs to only be the... (5 Replies)
Discussion started by: cmccabe
5 Replies

8. Shell Programming and Scripting

Bash to select oldest folder in directory and write to log

In the bash below the oldest folder in a directory is selected. If there are 3folders in the directory /home/cmccabe/Desktop/NGS/test and nothing is done to them (ie. no files deleted, renamed) then the bash correctly identifies f1 as the oldest. However, if something is done to the folder then... (4 Replies)
Discussion started by: cmccabe
4 Replies

9. Shell Programming and Scripting

Create automated scan of specific directory using bash

I am trying to use bash to automate the scan of a specific directory using clamav. Having this in place is a network requirement. The below is an attempt to: 1. count the extensions (.txt, .jpeg) in a directory and write them to a virus-scan.log (section in bold) 2. scan each folder in the... (6 Replies)
Discussion started by: cmccabe
6 Replies

10. Shell Programming and Scripting

Bash to move specific files to directory based on match to file

I am trying to mv each of the .vcf files in the variants folder to the folder in /home/cmccabe/f2 that the .vcf id is found in file. $2 in file will always have the id of a .vcf in the variants folder. The line in blue staring with R_2019 in file up to the -v5.6 will always be an exact match to a... (4 Replies)
Discussion started by: cmccabe
4 Replies
menu_win(3X)															      menu_win(3X)

NAME
menu_win - make and break menu window and subwindow associations SYNOPSIS
#include <menu.h> int set_menu_win(MENU *menu, WINDOW *win); WINDOW *menu_win(const MENU *menu); int set_menu_sub(MENU *menu, WINDOW *sub); WINDOW *menu_sub(const MENU *menu); int scale_menu(const MENU *menu, int *rows, int *columns); DESCRIPTION
Every menu has an associated pair of curses windows. The menu window displays any title and border associated with the window; the menu subwindow displays the items of the menu that are currently available for selection. The first four functions get and set those windows. It is not necessary to set either window; by default, the driver code uses stdscr for both. In the set_ functions, window argument of NULL is treated as though it were stsdcr. A menu argument of NULL is treated as a request to change the system default menu window or subwindow. The function scale_menu returns the minimum size required for the subwindow of menu. RETURN VALUE
Routines that return pointers return NULL on error. Routines that return an integer return one of the following error codes: E_OK The routine succeeded. E_SYSTEM_ERROR System error occurred (see errno). E_BAD_ARGUMENT Routine detected an incorrect or out-of-range argument. E_POSTED The menu has already been posted. E_NOT_CONNECTED No items are connected to the menu. SEE ALSO
curses(3X), menu(3X). NOTES
The header file <menu.h> automatically includes the header file <curses.h>. PORTABILITY
These routines emulate the System V menu library. They were not supported on Version 7 or BSD versions. AUTHORS
Juergen Pfeifer. Manual pages and adaptation for new curses by Eric S. Raymond. menu_win(3X)
All times are GMT -4. The time now is 10:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy