Sponsored Content
Top Forums Shell Programming and Scripting Perl error in batch command but works one at a time Post 302990891 by Corona688 on Thursday 2nd of February 2017 10:24:49 AM
Old 02-02-2017
That is not Perl. The membrane-thin wrapper of Perl serves literally no purpose. That is nothing but shell code. If you write the loop inside shell you'll save so much trouble and CPU time.

I too made this error when first learning to program in Perl and shell. Learn a little more shell and it will make more sense.

You can also split across multiple lines for readability by putting backslash-newline wherever you need to split it.
Code:
while read LINE
do
        echo perl table_annovar.pl -vcfinput "$LINE" humandb/ -buildver hg19 -arg '-hgvs',,,,, -remove -protocol \
                IDP.refGene,avsnp147,popfreq_all_20150413,spidex,dbnsfp33a,clinvar_20161128 \
                -operation g,f,f,f,f,f -otherinfo -nastring .
done < target.txt

Remove the echo once you've tested and made sure it does what you want.

Last edited by Corona688; 02-02-2017 at 11:32 AM..
This User Gave Thanks to Corona688 For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

time stamp perl script error out of range 1..31

Hi, while running the perl script i am getting this error message , Day '' out of range 1..31 at rsty.sh line 44 what do iam missing in the script, any suggestion #!/usr/bin/perl use Time::Local; my $wday = $ARGV; my $month = $ARGV; # convert the month shortname into 0-11 number if... (4 Replies)
Discussion started by: saha
4 Replies

2. HP-UX

Strange- RCP command works every other time

This just started happening. I use the rcp command to copy a file from one server to another. Now when I use the command, every other time I execute the exact same command I get the error: remshd: login correct Example: 1. rcp testfile server2:/db/tmp (Work ok, verified file... (6 Replies)
Discussion started by: jrowland
6 Replies

3. Shell Programming and Scripting

perl/unix: script in command line works but not in perl

so in unix this command works works and shows me a list of directories find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt but when i try running a perl script to run this command my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
Discussion started by: kpddong
2 Replies

4. Shell Programming and Scripting

Syntax error piping to bc on command line - works when assigned to var

I have a script which outputs some timing data a line at a time. There are approx. 10 lines echoed, each line looks something like this: 0.741 http://checkip.dyndns.org 94.170.119.226Since I needed to add all the values in the first column, I piped the output to grep, matching and printing the... (7 Replies)
Discussion started by: gencon
7 Replies

5. Windows & DOS: Issues & Discussions

Command works on CMD line but not in batch?

Hi All, This command works when I type it on but when I run the batch file it doesn't..any ideas why? attrib.exe * | find /c /v "" >filecount.txt (1 Reply)
Discussion started by: Grueben
1 Replies

6. Shell Programming and Scripting

Ftp script hangs for first time,but works every second time

Hi I have an ftp script which works fine when i execute through a test scheduler(UC4), but when i run it through the prod scheduler(UC4), it hungs indefinetely, when we cancel the job and re-run it it works perfectly fine. here is the code,, any idea why this is happening ???? ... (1 Reply)
Discussion started by: selvankj
1 Replies

7. Shell Programming and Scripting

Xentop Batch Time Display Help

I would like to be able to display the local time (or anytime for that matter) when I run Xentop in batch mode. Is that possible? (In other words, when I look back at the data, I want to be able to tell what time that the output was displayed). (2 Replies)
Discussion started by: Coyote2012
2 Replies

8. Shell Programming and Scripting

perl: Command works in terminal, but not in shell script

Hi, the following command works in the terminal no problem. samtools view -h rawlib.bam | perl -ne '{ @line = split( /\s+/ ); $match = 0; while( $line =~ /(\d+)M/g ) { $match = $match + $1 } if( $match >= 80 || $_ =~ /^\@/ ) { print $_ } }' | java -Xmx12G -jar... (8 Replies)
Discussion started by: jdilts
8 Replies

9. Shell Programming and Scripting

Script in bash that works only some of the time

I ran this script yesterday (in the background) /usr/bin/nohup myfilelocation/myscriptname.sh & the script worked perfectly. i ran it today (also in the background) and just sat there. So i killed it and ran it normally and it worked perfectly. Anyone suggest why it just sat there and... (8 Replies)
Discussion started by: twinion
8 Replies
QSTAT(P)						     POSIX Programmer's Manual							  QSTAT(P)

NAME
qstat - show status of batch jobs SYNOPSIS
qstat [-f] job_identifier ... qstat -Q [-f] destination ... qstat -B [-f] server_name ... DESCRIPTION
The status of a batch job, batch queue, or batch server is obtained by a request to the server. The qstat utility is a user-accessible batch client that requests the status of one or more batch jobs, batch queues, or servers, and writes the status information to standard output. For each successfully processed batch job_identifier, the qstat utility shall display information about the corresponding batch job. For each successfully processed destination, the qstat utility shall display information about the corresponding batch queue. For each successfully processed server name, the qstat utility shall display information about the corresponding server. The qstat utility shall acquire batch job status information by sending a Job Status Request to a batch server. The qstat utility shall acquire batch queue status information by sending a Queue Status Request to a batch server. The qstat utility shall acquire server status information by sending a Server Status Request to a batch server. OPTIONS
The qstat utility shall conform to the Base Definitions volume of IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines. The following options shall be supported by the implementation: -f Specify that a full display is produced. The minimum contents of a full display are specified in the STDOUT section. Additional contents and format of a full display are implementation-defined. -Q Specify that the operand is a destination. The qstat utility shall display information about each batch queue at each destination identified as an operand. -B Specify that the operand is a server name. The qstat utility shall display information about each server identified as an operand. OPERANDS
If the -Q option is presented to the qstat utility, the utility shall accept one or more operands that conform to the syntax for a destina- tion (see Destination ). If the -B option is presented to the qstat utility, the utility shall accept one or more server_name operands. If neither the -B nor the -Q option is presented to the qstat utility, the utility shall accept one or more operands that conform to the syntax for a batch job_identifier (see Batch Job Identifier ). STDIN
Not used. INPUT FILES
None. ENVIRONMENT VARIABLES
The following environment variables shall affect the execution of qstat: HOME Determine the pathname of the user's home directory. LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of IEEE Std 1003.1-2001, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_COLLATE Determine the locale for the behavior of ranges, equivalence classes, and multi-character collating elements within regular expres- sions. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. LC_NUMERIC Determine the locale for selecting the radix character used when writing floating-point formatted output. ASYNCHRONOUS EVENTS
Default. STDOUT
If an operand presented to the qstat utility is a batch job_identifier and the -f option is not specified, the qstat utility shall display the following items on a single line, in the stated order, with white space between each item, for each successfully processed operand: * The batch job_identifier * The batch job name * The Job_Owner attribute * The CPU time used by the batch job * The batch job state * The batch job location If an operand presented to the qstat utility is a batch job_identifier and the -f option is specified, the qstat utility shall display the following items for each success fully processed operand: * The batch job_identifier * The batch job name * The Job_Owner attribute * The execution user ID * The CPU time used by the batch job * The batch job state * The batch job location * Additional implementation-defined information, if any, about the batch job or batch queue If an operand presented to the qstat utility is a destination, the -Q option is specified, and the -f option is not specified, the qstat utility shall display the following items on a single line, in the stated order, with white space between each item, for each successfully processed operand: * The batch queue name * The maximum number of batch jobs that shall be run in the batch queue concurrently * The total number of batch jobs in the batch queue * The status of the batch queue * For each state, the number of batch jobs in that state in the batch queue and the name of the state * The type of batch queue (execution or routing) If the operands presented to the qstat utility are destinations, the -Q option is specified, and the -f option is specified, the qstat utility shall display the following items for each successfully processed operand: * The batch queue name * The maximum number of batch jobs that shall be run in the batch queue concurrently * The total number of batch jobs in the batch queue * The status of the batch queue * For each state, the number of batch jobs in that state in the batch queue and the name of the state * The type of batch queue (execution or routing) * Additional implementation-defined information, if any, about the batch queue If the operands presented to the qstat utility are batch server names, the -B option is specified, and the -f option is not specified, the qstat utility shall display the following items on a single line, in the stated order, with white space between each item, for each suc- cessfully processed operand: * The batch server name * The maximum number of batch jobs that shall be run in the batch queue concurrently * The total number of batch jobs managed by the batch server * The status of the batch server * For each state, the number of batch jobs in that state and the name of the state If the operands presented to the qstat utility are server names, the -B option is specified, and the -f option is specified, the qstat utility shall display the following items for each successfully processed operand: * The server name * The maximum number of batch jobs that shall be run in the batch queue concurrently * The total number of batch jobs managed by the server * The status of the server * For each state, the number of batch jobs in that state and the name of the state * Additional implementation-defined information, if any, about the server STDERR
The standard error shall be used only for diagnostic messages. OUTPUT FILES
None. EXTENDED DESCRIPTION
None. EXIT STATUS
The following exit values shall be returned: 0 Successful completion. >0 An error occurred. CONSEQUENCES OF ERRORS
In addition to the default behavior, the qstat utility shall not be required to write a diagnostic message to standard error when the error reply received from a batch server indicates that the batch job_identifier does not exist on the server. Whether or not the qstat utility waits to output the diagnostic message while attempting to locate the batch job on other servers is implementation-defined. The following sections are informative. APPLICATION USAGE
None. EXAMPLES
None. RATIONALE
The qstat utility allows users to display the status of jobs and list the batch jobs in queues. The operands of the qstat utility may be either job identifiers, queues (specified as destination identifiers), or batch server names. The -Q and -B options, or absence thereof, indicate the nature of the operands. The other options of the qstat utility allow the user to control the amount of information displayed and the format in which it is dis- played. Should a user wish to display the status of a set of jobs that match a selection criteria, the qselect utility may be used to acquire such a list. The -f option allows users to request a "full" display in an implementation-defined format. Historically, the qstat utility has been a part of the NQS and its derivatives, the existing practice on which it is based. FUTURE DIRECTIONS
None. SEE ALSO
Batch Environment Services , qselect COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 QSTAT(P)
All times are GMT -4. The time now is 08:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy