Sponsored Content
Top Forums Shell Programming and Scripting Bash to select text and apply it to a selected file in bash Post 302982542 by cmccabe on Thursday 29th of September 2016 04:57:30 PM
Old 09-29-2016
Did I add it in the wrong place? Thanks.

Code:
FILESDIR=/home/cmccabe/Desktop/ref/validation/val
PANELDIR=/home/cmccabe/Desktop/ref/validation/panels

PS3="please select a panel: "

cd "$PANELDIR"
select bed in $(ls *.txt)
do    [ "$bed" != "" ] && break
done

PS3="please select a file to analyze with a panel: "

cd "$FILESDIR"
select file1 in $(ls *.vcf)
do    [ "$file1" != "" ] && break
done
      printf "FILE is: ${file1} and will be used filtered to ${bed} \n"
      read -r -p "Is this correct? [y/N] " response
    if [[ $response =~ ^[nN][oO]?$ ]]
         then
         echo 'please try again'  && exit
    else
    fi
logfile="/home/cmccabe/Desktop/ref/validation/val/process.log"
for f in /home/cmccabe/Desktop/ref/validation/val/$file1 ; do
     echo "Start filter creation: $(date) - File: $f"
     bname=$(basename $f)
     pref=${bname%%_*.txt}
     grep -wFf /home/cmccabe/Desktop/ref/validation/panels/$bed $f >/home/cmccabe/Desktop/ref/validation/filtered/${pref}_filtered.txt
     echo "End filder creation: $(date) - File: $f"
done >> "$logfile"
syntax error near unexpected token `fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

select in ksh, any guidance for bash?

I have a file driven menu using the select feature in ksh. I like doing it this way, however I would prefer running a bash. Is there some eqivalent way of doing this in a bash shell? ie select file in *.ascii  do typeset -u REPLY if  ; then... (1 Reply)
Discussion started by: Shakey21
1 Replies

2. Shell Programming and Scripting

Drop down menu in bash for timezone select

Is there any way to implement a drop down menu selection in bash? This is on CDLinux which is a very minimal live CD and I am using it to install an image onto a hard drive. Part of that process is the timezone selection. There are just too many timezones to attempt to use the "select" command.... (1 Reply)
Discussion started by: simonb
1 Replies

3. Shell Programming and Scripting

[bash help]Adding multiple lines of text into a specific spot into a text file

I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it. For example, Here is a portion of a zone file. IN NS ns1.domain.tld. IN NS ns2.domain.tld. IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies

4. Shell Programming and Scripting

Select columns from a matrix given within a range in BASH

I have a huge matrix file which looks like this (example matrix): 1 2 3 5 4 5 6 7 7 6 8 9 1 2 4 2 7 6 5 1 3 2 1 9 As one can see, this matrix has 4 columns and 6 rows. But my original matrix has some 3 million rows and 6000 columns. For example, on this matrix I can define my task as... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

5. Shell Programming and Scripting

Reading a text file using bash

I've a file in linux with following text: ;ip address hostname put-location alt-put-location tftpserver 192.168.1.1 r01-lab1-net /mnt/nas1/fgbu/ /opt/fgbu/devicebackup 192.168.1.254Now I want to read these values and assign them to particular variables... (6 Replies)
Discussion started by: kashif.live
6 Replies

6. Shell Programming and Scripting

How to pass enter key or selected character in bash script?

hi, i've bash script thats working... but now i need to add a line....that prompts for user input....like yes and 1 as complete install.... so here's how it looks... $ cd 9200 (cd into directory) $./install (hv to type ./install to run install then ask for) ----do you want to... (4 Replies)
Discussion started by: kernel11
4 Replies

7. Shell Programming and Scripting

Bash to select panel then specific file in directory

I am using bash to prompt a user for a choice using: where a "y" response opens a menu with available panels that can be used. while true; do read -p "Do you want to get coverage of a specific panel?" yn case $yn in * ) menu; break;; * ) exit;; * ) echo... (6 Replies)
Discussion started by: cmccabe
6 Replies

8. 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

9. Shell Programming and Scripting

Use same file selected in first bash process that has matching digits in it fot the second

In the below portion of a bash script the user selects a file from a directory. select file in $(cd /home/cmccabe/Desktop/NGS/API/5-14-2016/bedtools;ls);do break;done files in directory 123_base_counts.txt 456_base_counts.txt 789_base_counts.txt second portion of bash currently (user... (4 Replies)
Discussion started by: cmccabe
4 Replies

10. Shell Programming and Scripting

How can I apply 'date' command to specific columns, in a BASH script?

Hi everyone, I have a situation in which I have multiple (3 at last count) date columns in a CSV file (, delim), which need to be changed from: January 1 2017 (note, no comma after day) to: YYYY-MM-DD So far, I am able to convert a date using: date --date="January 12, 1990" +%Y-%m-%d ... (7 Replies)
Discussion started by: richardsantink
7 Replies
gnome-panel-preferences(1)					   User Commands					gnome-panel-preferences(1)

NAME
gnome-panel-preferences - configure the behavior of panels SYNOPSIS
gnome-panel-preferences [gnome-std-options] DESCRIPTION
The Panel preference tool enables you to configure the behavior of all of your panels. OPTIONS
The following options are supported: gnome-std-optionStandard options available for use with most GNOME applications. See gnome-std-options(5). EXAMPLES
Example 1: Launching the Panel preference tool example% gnome-panel-preferences EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/gnome-panel-preExecutable for Panel preferences tool ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWgnome-panel | +-----------------------------+-----------------------------+ |Interface stability |External | +-----------------------------+-----------------------------+ SEE ALSO
Preference Tools Manual Latest version of the GNOME Desktop User Guide for your platform. gnome-panel(1), gnome-std-options(5) NOTES
Written by Glynn Foster, Sun Microsystems Inc., 2003. SunOS 5.10 2 Oct 2003 gnome-panel-preferences(1)
All times are GMT -4. The time now is 05:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy