Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Strange results from 'strings | sort' Post 303038693 by edstevens on Wednesday 11th of September 2019 12:28:44 PM
Old 09-11-2019
Strange results from 'strings | sort'

Using the 'strings' command and piping the result to 'sort' is producing strange results. I get block of lines that begin with asterisks, then a block that begins with some text, then more lines that begin with asterisks. The actual content is correct - lines beginning with asterisks is the actual content of the file. My question is about the resulting sort order. Within a grouping things are in order, but I don't understand why the lines beginning with an asterisk are broken into two groups, separated by a group of lines that begin with an alphabetic character.



Code:
oracle:mydb$ strings spfilemydb.ora | sort
*.audit_file_dest='/u01/app/oracle/admin/mydb/adump'
*.audit_sys_operations=TRUE
*.audit_trail='DB'
*.compatible='12.1.
*.control_files='+DEV_DATA/mydb/controlfile/control01.ctl','+DEV_DATA/mydb/controlfile/control02.ctl'#Restore Controlfile
*.db_block_size=8192
*.db_create_file_dest='+DEV_DATA'
*.db_domain=''
*.db_file_name_convert='+DATA/dwprd/datafile','+DEV_DATA/MYDB/DATAFILE','+DATA/dwprd','+DEV_DATA/mydb'
*.db_name='MYDB'#Reset to original value by RMAN
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=mydbXDB)'
mydb.__data_transfer_cache_size=0
mydb.__db_cache_size=1392508928
mydb.__java_pool_size=167772160
mydb.__large_pool_size=251658240
mydb.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
mydb.__pga_aggregate_target=436207616
mydb.__sga_target=2147483648
mydb.__shared_io_pool_size=0
mydb.__shared_pool_size=318767104
mydb.__streams_pool_size=0
*.event=''
*.java_pool_size=167772160
*.job_queue_
*.local_listener='(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=REGISTER)))'
*.log_archive_dest_1='location=/backup/mydb/archive'
*.open_cursors=300
*.pga_aggregate_limit=2147483648
processes=1000
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_max_size=2147483648
*.sga_target=2147483648
*.shared_pool_reserved_size=8388608
*.shared_pool_size=255852544

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to sort find results

Hi-- Ok. I have now found that: find -x -ls will do what I need as far as finding all files on a particular volume. Now I need to sort the results by the file's modification date/time. Is there a way to do that? Also, I notice that for many files, whereas the man for find says ls is... (8 Replies)
Discussion started by: groundlevel
8 Replies

2. AIX

Strange ls results..

Multipart question.. Can anybody explain why this happens : -rw-rw-r-- 1 fnsw fnusr 1531061 Feb 13 21:45 filename1.log -rw-rw-r-- 1 fnsw fnusr 1760706 Feb 10 22:10 filename2.log -rw-rw-r-- 1 fnsw fnusr 1525805 Aug 16 2005 filename3.log -rw-rw-r-- 1... (3 Replies)
Discussion started by: dbridle
3 Replies

3. UNIX for Dummies Questions & Answers

Strange Results

I am using th following to get the percentage and have never used bc before: percent=$(echo "scale=4;(34117/384000)*100" | bc) 8.884600 percent=$(echo "scale=2;(34117/384000)*100" | bc) 8.00 Why do I get the results of 8.00 instead of 8.88 when using a scale of 2. I only want 2 decimal... (2 Replies)
Discussion started by: mariaa33
2 Replies

4. UNIX for Advanced & Expert Users

Sort command - strange behaviour

Hi guys, I have the following example data: A;00:00:19 B;00:01:02 C;00:00:13 D;00:00:16 E;00:02:27 F;00:00:12 G;00:00:21 H;00:00:19 I;00:00:13 J;00:13:22 I run the following sort against it, yet the output is as follows: sort -t";" +1 -nr example_data.dat A;00:00:19 (16 Replies)
Discussion started by: miwinter
16 Replies

5. Shell Programming and Scripting

Strange results from FDISK?????

Hi all, I am writing script that returns the size of each disk or partition when called. I am using FDISK -l and parsing the results to get the result I want. When I execute fdisk -l it shows correct results, BUT when I execute the same thing with results to be put in a variable, I get strange... (5 Replies)
Discussion started by: alirezan
5 Replies

6. Shell Programming and Scripting

Help with sort folder results

Here is the code, but the list is not sorted properly (alphabetically)? <?php function folderlist(){ $startdir = './'; $ignoredDirectory = '.'; $ignoredDirectory = '..'; if (is_dir($startdir)){ if ($dh = opendir($startdir)){ while (($folder = readdir($dh)) !== false){ if... (0 Replies)
Discussion started by: mrlayance
0 Replies

7. UNIX for Dummies Questions & Answers

sort find results

Hi, I have a problem with a shell script. The script should find all .cpp and .h files and list them. With: for file in `find $src -name '*.h' -o -name '*.cpp' it gives out this: H:\FileList\A\E\F\G\newCppFile.cpp H:\FileList\header01.h H:\FileList\B\nextCppFile.cpp ... (4 Replies)
Discussion started by: shellBeginner75
4 Replies

8. UNIX for Advanced & Expert Users

Rsync in progress, strange results

Disclaimer, I've been a Linux admin for a while but don't frequently setup rsysnc jobs. Here's the command I'm running on CentOS 5.5, rsync 2.6.8: rsync -arvz --progress --compress-level=9 /src/ /dest/ /src has 1.5 TB of data, /dest/ is a new destination and started out empy. Oh ya, both... (4 Replies)
Discussion started by: DustinT
4 Replies

9. Shell Programming and Scripting

Find with rm command gives strange results

I want to remove any files that are older than 2 days from a directory. It deletes those files. Then it comes back with a message it is a directory. What am I doing wrong here? + find /mydir -mtime +2 -exec rm -f '{}' ';' rm: /mydir is a directory (2 Replies)
Discussion started by: jtamminen
2 Replies

10. UNIX for Beginners Questions & Answers

Strange sort -r results

Hi Folks - I have this file that looks like this: outbox/logs/Client_1042.log outbox/logs/Client_941.log outbox/logs/Client_942.log outbox/logs/Client_943.log outbox/logs/Client_944.log And this is my code: #!/bin/bash _OUTBOX_BIN="outbox/logs/" _NAME="Client" _TEMP="temp.txt"... (9 Replies)
Discussion started by: SIMMS7400
9 Replies
Bio::Tools::Run::StandAloneBlastPlus(3pm)		User Contributed Perl Documentation		 Bio::Tools::Run::StandAloneBlastPlus(3pm)

NAME
Bio::Tools::Run::StandAloneBlastPlus - Compute with NCBI's blast+ suite *ALPHA* SYNOPSIS
NOTE: This module is related to the Bio::Tools::Run::StandAloneBlast system in name (and inspiration) only. You must use this module directly. # existing blastdb: $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'mydb' ); # create blastdb from fasta file and attach $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'mydb', -db_data => 'myseqs.fas', -create => 1 ); # create blastdb from BioPerl sequence collection objects $alnio = Bio::AlignIO->new( -file => 'alignment.msf' ); $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'mydb', -db_data => $alnio, -create => 1 ); @seqs = $alnio->next_aln->each_seq; $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'mydb', -db_data => @seqs, -create => 1 ); # create database with masks $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'my_masked_db', -db_data => 'myseqs.fas', -masker => 'dustmasker', -mask_data => 'maskseqs.fas', -create => 1 ); # create a mask datafile separately $mask_file = $fac->make_mask( -data => 'maskseqs.fas', -masker => 'dustmasker' ); # query database for metadata $info_hash = $fac->db_info; $num_seq = $fac->db_num_sequences; @mask_metadata = @{ $fac->db_filter_algorithms }; # perform blast methods $result = $fac->tblastn( -query => $seqio ); # see Bio::Tools::Run::StandAloneBlastPlus::BlastMethods # for many more details DESCRIPTION
NOTE: This module requires BLAST+ v. 2.2.24+ and higher. Until the API stabilizes for BLAST+, consider this module highly experimental. This module along with Bio::Tools::Run::StandAloneBlastPlus::BlastMethods allows the user to perform BLAST functions using the external program suite "blast+" (available at <ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST/>), using BioPerl objects and Bio::SearchIO facilities. This wrapper can prepare BLAST databases as well as run BLAST searches. It can also be used to run "blast+" programs independently. This module encapsulates object construction and production of databases and masks. Blast analysis methods ("blastp, psiblast", etc>) are contained in Bio::Tools::Run::StandAloneBlastPlus::BlastMethods. USAGE
The basic mantra is to(1) create a BlastPlus factory using the "new()" constructor, and(2) perform BLAST analyses by calling the desired BLAST program by name off the factory object. The blast database itself and any masking data are attached to the factory object (step 1). Query sequences and any parameters associated with particular programs are provided to the blast method call (step 2), and are run against the attached database. Factory construction/initialization The factory needs to be told where the blast+ programs live. The "BLASTPLUSDIR" environment variable will be checked for the default executable directory. The program directory can be set for individual factory instances with the "PROG_DIR" parameter. All the blast+ programs must be accessible from that directory (i.e., as executable files or symlinks). Either the database or BLAST subject data must be specified at object construction. Databases can be pre-existing formatted BLAST dbs, or can be built directly from fasta sequence files or BioPerl sequence object collections of several kinds. The key constructor parameters are "DB_NAME", "DB_DATA", "DB_DIR". To specify a pre-existing BLAST database, use "DB_NAME" alone: $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -DB_NAME => 'mydb' ); The directory can be specified along with the basename, or separately with "DB_DIR": $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -DB_NAME => '~/home/blast/mydb' ); #same as $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -DB_NAME => 'mydb', -DB_DIR => '~/home/blast' ); To create a BLAST database de novo, see "Creating a BLAST database". If you wish to apply pre-existing mask data (i.e., the final ASN1 output from one of the blast+ masker programs), to the database before querying, specify it with "MASK_FILE": $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -DB_NAME => 'mydb', -MASK_FILE => 'mymaskdata.asn' ); Creating a BLAST database There are several options for creating the database de novo using attached data, both before and after factory construction. If a temporary database (one that can be deleted by the "cleanup()" method) is desired, leave out the "-db_name" parameter. If "-db_name" is specified, the database will be preserved with the basename specified. Use "-create =" 1> to create a new database (otherwise the factory will look for an existing database). Use "-overwrite =" 1> to create and overwrite an existing database. Note that the database is not created immediately on factory construction. It will be created if necessary on the first use of a factory BLAST method, or you can force database creation by executing $fac->make_db(); o Specify data during construction With a FASTA file: $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'mydb', -db_data => 'myseqs.fas', -create => 1 ); With another BioPerl object collection: $alnio = Bio::AlignIO->new( -file => 'alignment.msf' ); $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'mydb', -db_data => $alnio, -create => 1 ); @seqs = $alnio->next_aln->each_seq; $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'mydb', -db_data => @seqs, -create => 1 ); Other collections (e.g., Bio::SeqIO) are valid. If a certain type does not work, please submit an enhancement request. To create temporary databases, leave out the "-db_name", e.g. $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_data => 'myseqs.fas', -create => 1 ); To get the tempfile basename, do: $dbname = $fac->db; o Specify data post-construction Use the explicit attribute setters: $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -create => 1 ); $fac->set_db_data('myseqs.fas'); $fac->make_db; Creating and using mask data The blast+ mask utilities "windowmasker", "segmasker", and "dustmasker" are available. Masking can be rolled into database creation, or can be executed later. If your mask data is already created and in ASN1 format, set the "-mask_file" attribute on construction (see "Factory constuction/initialization"). To create a mask from raw data or an existing database and apply the mask upon database creation, construct the factory like so: $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'my_masked_db', -db_data => 'myseqs.fas', -masker => 'dustmasker', -mask_data => 'maskseqs.fas', -create => 1 ); The masked database will be created during "make_db". The "-mask_data" parameter can be a FASTA filename or any BioPerl sequence object collection. If the datatype ('nucl' or 'prot') of the mask data is not compatible with the selected masker, an exception will be thrown with a message to that effect. To create a mask ASN1 file that can be used in the "-mask_file" parameter separately from the attached database, use the "make_mask()" method directly: $mask_file = $fac->make_mask(-data => 'maskseqs.fas', -masker => 'dustmasker'); # segmasker can use a blastdb as input $mask_file = $fac->make_mask(-mask_db => 'mydb', -masker => 'segmasker') $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'my_masked_db', -db_data => 'myseqs.fas', -mask_file => $mask_file -create => 1 ); Getting database information To get a hash containing useful metadata on an existing database (obtained by running "blastdbcmd -info", use "db_info()": # get info on the attached database.. $info = $fac->db_info; # get info on another database $info = $fac->db_info('~/home/blastdbs/another'); To get a particular info element for the attached database, just call the element name off the factory: $num_seqs = $fac->db_num_sequences; # info on all the masks applied to the db, if any: @masking_info = @{ $fac->db_filter_algorithms }; Accessing the Bio::Tools::Run::BlastPlus factory The blast+ programs are actually executed by a Bio::Tools::Run::BlastPlus wrapper instance. This instance is available for peeking and poking in the StandAloneBlastPlus "factory()" attribute. For convenience, "BlastPlus" methods can be run from the "StandAloneBlastPlus" object, and are delegated to the "factory()" attribute. For example, to get the blast+ program to be executed, examine either $fac->factory->command or $fac->command Similarly, the current parameters for the "BlastPlus" factory are @parameters = $fac->get_parameters Cleaning up temp files Temporary analysis files produced under a single factory instances can be unlinked by running $fac->cleanup; Tempfiles are generally not removed unless this method is explicitly called. "cleanup()" only unlinks "registered" files and databases. All temporary files are automatically registered; in particular, "anonymous" databases (such as $fac->Bio::Tools::Run::StandAloneBlastPlus->new( -db_data => 'myseqs.fas', -create => 1 ); without a "-db_name" specification) are registered for cleanup. Any file or database can be registered with an internal method: $fac->_register_temp_for_cleanup('testdb'); Other Goodies o You can check whether a given basename points to a properly formatted BLAST database by doing $is_good = $fac->check_db('putative_db'); o User parameters can be passed to the underlying blast+ programs (if you know what you're doing) with "db_make_args" and "mask_make_args": $fac = Bio::Tools::Run::StandAloneBlastPlus->new( -db_name => 'customdb', -db_data => 'myseqs.fas', -db_make_args => [ '-taxid_map' => 'seq_to_taxa.txt' ], -masker => 'windowmasker', -mask_data => 'myseqs.fas', -mask_make_args => [ '-dust' => 'T' ], -create => 1 ); o You can prevent exceptions from being thrown by failed blast+ program executions by setting "no_throw_on_crash". Examine the error with "stderr()": $fac->no_throw_on_crash(1); $fac->make_db; if ($fac->stderr =~ /Error:/) { #handle error ... } SEE ALSO
Bio::Tools::Run::StandAloneBlastPlus::BlastMethods, Bio::Tools::Run::BlastPlus FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: http://redmine.open-bio.org/projects/bioperl/ AUTHOR - Mark A. Jensen Email maj -at- fortinbras -dot- us CONTRIBUTORS
APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new Usage : my $obj = new Bio::Tools::Run::StandAloneBlastPlus(); Function: Builds a new Bio::Tools::Run::StandAloneBlastPlus object Returns : an instance of Bio::Tools::Run::StandAloneBlastPlus Args : named argument (key => value) pairs: -db : blastdb name db() Title : db Usage : $obj->db($newval) Function: contains the basename of the local blast database Example : Returns : value of db (a scalar string) Args : readonly factory() Title : factory Usage : $obj->factory($newval) Function: attribute containing the Bio::Tools::Run::BlastPlus factory Example : Returns : value of factory (Bio::Tools::Run::BlastPlus object) Args : readonly program_version() Title : program_version Usage : $version = $bedtools_fac->program_version() Function: Returns the program version (if available) Returns : string representing location and version of the program Note : this works around the WrapperBase::version() method conflicting with the -version parameter for SABlast (good argument for not having getter/setters for these) package_version() Title : package_version Usage : $version = $bedtools_fac->package_version() Function: Returns the BLAST+ package version (if available) Returns : string representing BLAST+ package version (may differ from version()) DB methods make_db() Title : make_db Usage : Function: create the blast database (if necessary), imposing masking if specified Returns : true on success Args : make_mask() Title : make_mask Usage : Function: create masking data based on specified parameters Returns : mask data filename (scalar string) Args : db_info() Title : db_info Usage : Function: get info for database (via blastdbcmd -info); add factory attributes Returns : hash of database attributes Args : [optional] db name (scalar string) (default: currently attached db) set_db_make_args() Title : set_db_make_args Usage : Function: set the DB make arguments attribute with checking Returns : true on success Args : arrayref or hashref of named arguments set_mask_make_args() Title : set_mask_make_args Usage : Function: set the masker make arguments attribute with checking Returns : true on success Args : arrayref or hasref of named arguments check_db() Title : check_db Usage : Function: determine if database with registered name and dir exists Returns : 1 if db present, 0 if not present, undef if name/dir not set Args : [optional] db name (default is 'registered' name in $self->db) [optional] db directory (default is 'registered' dir in $self->db_dir) no_throw_on_crash() Title : no_throw_on_crash Usage : $fac->no_throw_on_crash($newval) Function: set to prevent an exeception throw on a failed blast program execution Example : Returns : value of no_throw_on_crash (boolean) Args : on set, new value (boolean) Internals _fastize() Title : _fastize Usage : Function: convert a sequence collection to a temporary fasta file (sans gaps) Returns : fasta filename (scalar string) Args : sequence collection _register_temp_for_cleanup() Title : _register_temp_for_cleanup Usage : Function: register a file for cleanup with cleanup() method Returns : true on success Args : a file name or a blastdb basename (scalar string) cleanup() Title : cleanup Usage : Function: unlink files registered for cleanup Returns : true on success Args : AUTOLOAD In this module, "AUTOLOAD()" delegates Bio::Tools::Run::WrapperBase and Bio::Tools::Run::WrapperBase::CommandExts methods (including those of Bio::ParamterBaseI) to the "factory()" attribute: $fac->stderr gives you $fac->factory->stderr If $AUTOLOAD isn't pointing to a WrapperBase method, then AUTOLOAD attempts to return a "db_info" attribute: e.g. $fac->db_num_sequences works by looking in the $fac->db_info() hash. Finally, if $AUTOLOAD is pointing to a blast query method, AUTOLOAD runs "run" with the "-method" parameter appropriately set. perl v5.12.3 2011-06-18 Bio::Tools::Run::StandAloneBlastPlus(3pm)
All times are GMT -4. The time now is 06:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy