Sponsored Content
Top Forums UNIX for Dummies Questions & Answers automatic tar xf of file with unknown name Post 302125898 by tkrahn on Monday 9th of July 2007 02:34:59 AM
Old 07-09-2007
Power

Thanks very much era!

The curl string was embedded inside a C source code and was hard coded compiled with the application (Hawkeye viewer for Amos, see http://amos.sourceforge.net). The author has used the % signs for replacing string segments by variables with a string function. It has nothing to do with DOS I think.
For this reason the slash was in front of the " to hide it and I forgot to delete it before I posted the thread.

Hawkeye has only space for a single command line, so I decided to put everything into an external script "fetchscf.sh" as you started it already. The command line in Hawkeye is now only

/usr/local/bin/fetchscf.sh %EID% %TRACECACHE%

fetchscf.sh contains:

<source>
#!/bin/sh

EID=$1
tracecache=$2

curl "http://www.ncbi.nlm.nih.gov/Traces/trace.fcgi?cmd=retrieve&save=1&srcf=1&scfrcf=scf&file=trace&val=$EID&ti=$EID" -s -o $tracecache/$EID.tar
tar tvf $tracecache/$EID.tar | grep ' \.scf$' | cut -d: -f2 | cut -b4- | xargs tar xOf $tracecache/$EID.tar >$tracecache/$EID.scf
</source>

Because tar tvf returned the whole info line including the date etc.
-rw-rw-r-- 0/0 106207 2007-07-09 00:29 2007_07_09_01h29m40s/BACILLUS_ANTHRACIS_STR._AMES_0581/TIGR/traces/BAEAT42TR.scf

I had to cut the string from the left side until the first character of the path name.
I wasn't sure if this length was always exactly constant, but I assumed that the time was always separated by ":" and then the fourth byte is the beginning of the path name. This explains the double cut in the pipe.
Maybe this is not perfectly elegant, but it works fine. It isn't worth making it more perfect, because NCBI will change the path names and URL parameters every three month or so.

Thanks again for your help!

Thomas
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Does tar do crc checking on a tape or tar file?

Trying to answer a question about whether tar table-of-contents is a good tool for verifying tape data. (1 Reply)
Discussion started by: tjlst15
1 Replies

2. Shell Programming and Scripting

extract one file form .tar.gz without uncompressing .tar.gz file

hi all, kindly help me how to extract one file form .tar.gz without uncompressing .tar.gz file. thanks in advance bali (2 Replies)
Discussion started by: balireddy_77
2 Replies

3. Solaris

PING - Unknown host 127.0.0.1, Unknown host localhost - Solaris 10

Hello, I have a problem - I created a chrooted jail for one user. When I'm logged in as root, everything work fine, but when I'm logged in as a chrooted user - I have many problems: 1. When I execute the command ping, I get weird results: bash-3.00$ usr/sbin/ping localhost ... (4 Replies)
Discussion started by: Przemek
4 Replies

4. UNIX for Advanced & Expert Users

Tar utility (untar a .tar file) on VxWorks

Hi All Can someone pls guide me if there any utility to compress file on windows & uncompress on vxworks I tried as - - compressed some folders on windows ... i created .tar ( to maintain directory structure ) and compressed to .gz format. - on VxWorks i have uncompressed it to .tar... (1 Reply)
Discussion started by: uday_01
1 Replies

5. UNIX for Advanced & Expert Users

GNU tar automatic gz detection/decompression

I stumbled on this feature on a SLES10 system yesterday... if you tar tf filename.tar.gz or tar xf filename.tar.gz it automatically gunzips the data for you. Has this feature been around for a while? I have 1.12 on my system, which doesn't, but the 1.20 manual mentions it... (3 Replies)
Discussion started by: Annihilannic
3 Replies

6. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

7. UNIX for Dummies Questions & Answers

Do I need to extract the entire tar file to confirm the tar folder is fine?

I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it. Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem? tar tvf file1.tar ... (1 Reply)
Discussion started by: vivien_chu
1 Replies

8. UNIX for Dummies Questions & Answers

UNIX command to check if file name ends with .tar OR if the file is a tar file

Hello Team, Would you please help me with a UNIX command that would check if file is a tar file. if we dont have that , can you help me with UNIX command that would check if file ends with .tar Thanks in advance. (10 Replies)
Discussion started by: sanjaydubey2006
10 Replies

9. AIX

Making Tar of directory and tar file is going to be placed

Quick question, is it possible to make a Tar of completely directory and placing the tar file in it (will this cause even the tar file to tarred ?) sample: /opt/freeware/bin/tar -cvf - /oracle | gzip > /oracle/backup.tgz will the tar file backup.tgz also include backup.tgz ? i tried... (5 Replies)
Discussion started by: filosophizer
5 Replies

10. AIX

Tar - pre-checking before making the Tar file

Coming from this thread, just wondering if there is an option to check if the Tar of the files/directory will be without any file-errors without actually making the tar. Scenario: Let's say you have a directory of 20GB, but you don't have the space to make Tar file at the moment, and you want... (14 Replies)
Discussion started by: filosophizer
14 Replies
BPSTATS2(1)							  BP executables						       BPSTATS2(1)

NAME
bpstats2 - Bundle Protocol (BP) processing statistics query utility via bundles SYNOPSIS
bpstats2 sourceEID [default destEID] [ct] DESCRIPTION
bpstats2 creates bundles containing the current values of all BP processing statistics accumulators. It creates these bundles when: o an interrogation bundle is delivered to sourceEID: the contents of the bundle are discarded, a new statistics bundle is generated and sent to the source of the interrogation bundle. The format of the interrogation bundle is irrelevant. o a SIGUSR1 signal is delivered to the bpstats2 application: a new statistics bundle is generated and sent to default destEID. EXIT STATUS
0 bpstats2 has terminated. Any problems encountered during operation will be noted in the ion.log log file. 1 bpstats2 failed to start up or receive bundles. Diagnose the issue reported in the ion.log file and try again. OPTIONS
[ct] If the string "ct" is appended as the last argument, then statistics bundles will be sent with custody transfer requested. FILES
No configuration files are needed. ENVIRONMENT
No environment variables apply. DIAGNOSTICS
The following diagnostics may be issued to the ion.log log file: bpstats2 can't bp_attach(). bpadmin has not yet initialized BP operations. bpstats2 can't open own endpoint. Another BP application has opened that endpoint; close it and try again. No space for ZCO extent. ION system error. Check for earlier diagnostic messages describing the cause of the error; correct problem and rerun. Can't create ZCO extent. ION system error. Check for earlier diagnostic messages describing the cause of the error; correct problem and rerun. bpstats2 can't send stats bundle. Bundle Protocol service to the remote endpoint has been stopped. Can't send stats: bad dest EID (dest EID) The destination EID printed is an invalid destination EID. The destination EID may be specified in default destEID or the source EID of the interrogation bundle. Ensure that default destEID is an EID that is valid for ION, and that the interrogator is a source EID that is also a valid destination EID. Note that "dtn:none" is not a valid destination EID, but is a valid source EID. NOTES
A very simple interrogator is bpchat which can repeatedly interrogate bpstats2 by just striking the enter key. BUGS
Report bugs to <ion-bugs@korgano.eecs.ohiou.edu> SEE ALSO
bpstats(1), bpchat(1) perl v5.14.2 2012-05-25 BPSTATS2(1)
All times are GMT -4. The time now is 01:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy