Sponsored Content
Full Discussion: Change directory error
Top Forums Shell Programming and Scripting Change directory error Post 302924691 by cmccabe on Tuesday 11th of November 2014 04:28:30 PM
Old 11-11-2014
That is a great suggestion Aia. I have been trying to make a bash to make it easier for users to use without needing much scripting, ideally none but as little as needed. Anyway, below is a start (I hope):
Code:
 
#!/usr/bin/perl

use strict;
use warnings;
use Switch;

my $input = '';

while ($input ne '7')
{
    clear_screen();

    print "type 1 for mutation match\n".
          "type 2 for annovar conversion\n". 
          "type 3 for individual or sanger annotation\n". 
          "type 4 for batch or sanger annotation\n". 
          "type 5 for individual noonan syndrome anotation\n".
		  "type 6 for batch noonan syndrome annotation\n".
          "type 7 to end\n";
		  
		   print "Enter your choice: ";
    $input = <STDIN>;
    chomp($input);

    switch ($input)
    {
        case '1'
        {
            $input = '';

I am not sure if that is correct or how to call a command based on the menu selection. For example, if 1 is inputed, then something like this needs to result.

Code:
 
printf "Enter ID  : "; read id
	printf "What panel: "; read panel
		cd 'C:\Users\cmccabe\Desktop\annovar'
			[ -z "$id" ] && break
			OMR=Output_Mutation_Report
	perl -aF/\\t/ -lne 'BEGIN{%m=map{chomp;s/\cM|\cJ//g;$p=join("\t",(split/\t/)[4,5]);($p,$_)} <>;$m{"#CHROM\tINFO"}=$m{"Chr\tSegment Position"}};/SEGPOS=(\d+)/ || /\t(INFO)\t/ or next;$p=$F[0]."\t".$1;exists $m{$p} and print join("\t",$_,$m{$p})' ${id}_${panel}_${OMR}.txt < ${id}_${panel}_${OMR}_Filtered.vcf > ${id}_matched.vcf

Thank you all for the great suggestions and ideas, I have a lot to learn Smilie.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

change directory

Hi all, I'm trying to wirte a small shell script in Linux. My script has the flow like, cmd1 cmd2 cd testdata cmd3 After exiting the program, the CWD remains the same as where I execute the program. I need it to be changed to the latest updated directory in the program. How can I do... (1 Reply)
Discussion started by: vadivel
1 Replies

2. Shell Programming and Scripting

change directory

hi, Iam in directory A. I run a script from there. inside the script i have a command cd B. When i come out of the script directory is A only. Even when i come out scrip i want the directory to be B How to achieve (2 Replies)
Discussion started by: mkan
2 Replies

3. Shell Programming and Scripting

Change Directory via a script?

I would like to have a script that would change my current working directory. However, any time I execute a 'cd' command in a script, it holds only for the life of that script -- the working directory on exit is the same as when the script was initiated. Is it possible to have the script return... (3 Replies)
Discussion started by: George Borrmann
3 Replies

4. UNIX for Dummies Questions & Answers

Change Directory

I have a directory that is existing under my root dir of the FTP server. The DIR name is 'Software Patch'. I want to move in to that DIR to download some patches. But, when I issued a command 'cd SOftware Patch', the system said that it cannot find the dir 'Software'. I tried all possible ways like... (2 Replies)
Discussion started by: vskr72
2 Replies

5. Shell Programming and Scripting

Change all filenames in a directory

I have a directory of files and each file has a random 5 digit string at the beginning that needs to be removed. Plus, there are some files that will be identically named after the 5 digit string is removed and I want those eliminated or moved. any ideas? (17 Replies)
Discussion started by: crumb
17 Replies

6. Shell Programming and Scripting

change directory if available

I have a simple shell script that prompts the user to enter a directory to navigate to. What i want it to do and i don't know how to do this is if the directory is invalid automatically navigate to the home directory. echo "enter a directory to navigate to:" read directory cd $directory... (6 Replies)
Discussion started by: icelated
6 Replies

7. UNIX for Dummies Questions & Answers

How to change database directory to another directory?

Hi, I Installed mysql on my CentOS 6.2 Server. But when I tried to change the location of /var/lib/mysql to another directory. I can't start the mysql. Below is what I've done yum install mysql mysql-server mysql-devel mkdir /path/to/new/ cp -R /var/lib/mysql /path/to/new chown -R... (1 Reply)
Discussion started by: ganitolngyundre
1 Replies

8. Shell Programming and Scripting

Change to directory and search some file in that directory in single command

I am trying to do the following task : export ENV=aaa export ENV_PATH=$(cd /apps | ls | grep $ENV) However, it's not working. What's the way to change to directory and search some file in that directory in single command Please help. (2 Replies)
Discussion started by: saurau
2 Replies

9. Shell Programming and Scripting

Change Directory

Hi All, There is a code like below in my script ############################################### ###Create Directories and Sub-Directories ############################################### dpdir=DP_FROM_${from}_TO_${to} mkdir $dpdir cd $dpdir mkdir AWQM WFCONTROLLER PROVCO PRISM ... (1 Reply)
Discussion started by: pvmanikandan
1 Replies

10. Shell Programming and Scripting

Change directory shell

#!/bin/bash echo -n "Enter number of sanger patients : "; read id perl -ne 'chomp; system ("perl table_annovar.pl $_ humandb/ -buildver hg19 -protocol refGene,popfreq_all,common,clinvar,clinvarsubmit,clinvarreference -operation g,f,f,f,f,f -otherinfo")' < file.txt I have the above script... (7 Replies)
Discussion started by: cmccabe
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 04:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy