Sponsored Content
Full Discussion: need extract command
Top Forums Shell Programming and Scripting need extract command Post 302555162 by aish11 on Wednesday 14th of September 2011 04:29:37 AM
Old 09-14-2011
Code:
[user01@rkfvm10 archive]$ ls
  20110913.tar.gz  log
[user01@10 archive]$ tar xzvf  20110913.tar.gz
tar: Removing leading `/' from member names
/home/user01/software/redeye/cep/adapter/sbpersistence/persistence.log
/home/user01/software/redeye/cep/adapter/sbpersistence/sb-jdbc.log
/home/user01/software/redeye/cep/adapter/sbpersistence/sbd.log
/home/user01/software/redeye/cep/adapter/sbpersistence/UnprocessedData.csv
/home/user01/software/redeye/cep/adapter/sbpersistence/UnprocessedData_20110913082032.csv
[user01@10 archive]$ ls
  20110913.tar.gz

please see above inforamtion carefully

my aim is when i am running ls command an archive path it should display
all the files containing that tar.it should not display again tar file.

please see below which are my requirements, which is not getting me.

Eg:
Code:
[user01@rkfvm10 archive]$ ls
  20110913.tar.gz  log
[user01@10 archive]$ tar xzvf  20110913.tar.gz
tar: Removing leading `/' from member names
/home/user01/software/redeye/cep/adapter/sbpersistence/persistence.log
/home/user01/software/redeye/cep/adapter/sbpersistence/sb-jdbc.log
/home/user01/software/redeye/cep/adapter/sbpersistence/sbd.log
/home/user01/software/redeye/cep/adapter/sbpersistence/UnprocessedData.csv
/home/user01/software/redeye/cep/adapter/sbpersistence/UnprocessedData_20110913082032.csv
[user01@10 archive]$ ls
/home/user01/software/redeye/cep/adapter/sbpersistence/persistence.log
/home/user01/software/redeye/cep/adapter/sbpersistence/sb-jdbc.log
/home/user01/software/redeye/cep/adapter/sbpersistence/sbd.log
/home/user01/software/redeye/cep/adapter/sbpersistence/UnprocessedData.csv
/home/user01/software/redeye/cep/adapter/sbpersistence/UnprocessedData_20110913082032.csv

Moderator's Comments:
Mod Comment Please use [code] and [/code] tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks. You got a PM with a guide.

Last edited by zaxxon; 09-14-2011 at 05:33 AM.. Reason: code tags, see PM
 

10 More Discussions You Might Find Interesting

1. Programming

extract command

hey i want to extract an argument from double qoutes, eg: when the user enters: prompt "mile" i need to extract everything within the double quotes, in my case, mile, and save it to a string. feedback/code would be appreciated thanks mile1982 (1 Reply)
Discussion started by: mile1982
1 Replies

2. UNIX for Dummies Questions & Answers

command to extract IP data from syslogs

Hello, I need to extract IP info from few large files into a single file with IP info only. I guess I can use grep, uniq and redirection but I not sure how. Is there a way to do this with a single command? Your help is greatly appreciated. (7 Replies)
Discussion started by: di0de
7 Replies

3. Shell Programming and Scripting

Extract first file only from ls command

I need help in extracting first file only from an ls command and store it in a local variable I thought using awk we could build something - not very familiar how to do it Something like ls -t $search_string and store the resultant first file alone into a local variable ( as my result... (4 Replies)
Discussion started by: prekida
4 Replies

4. UNIX for Dummies Questions & Answers

Extract time and host IP from 'who' command?

I have been slowly working towards getting a shell window in Cygwin (and/or Gnome and/or KDE) to start up and display the last time it was opened (or sourced) similarly to how the OS X Terminal does so. As close as I've been able to get so far is the 'who' command, but I can't seem to puzzle out... (2 Replies)
Discussion started by: SilversleevesX
2 Replies

5. Shell Programming and Scripting

extract columns from command output

I need to extract information (for example, file owner, directory path, etc). However, the code below does not work? What is wrong? find /usr/local/www/apache22/data/dev/chown_test -ls for i in * do cut -f 1,2 "$i" | echo done (3 Replies)
Discussion started by: montana24
3 Replies

6. UNIX for Dummies Questions & Answers

exp command to extract particular rows

Hi, I'm new to unix so hopefully you can help! I'm using the below command to extract a tables contents and store it in a dmp file: exp OWNER/OWNER@LINK FILE=exp.dat TABLES=TABLE_TEST This works fine and dumps the table into the exp.dat file. What i can't figure out, is how to... (3 Replies)
Discussion started by: boijie
3 Replies

7. Shell Programming and Scripting

expr command to extract words

how to use expr command to retrieve all the words before the equal sign "=" with shell script (3 Replies)
Discussion started by: 76455
3 Replies

8. Shell Programming and Scripting

Extract tty from ps command

When I try to extract tty from ps command , at time we get output , at times we dont. for eg i executed below quesry continulusly for some time,Actually i feel its because sometime pid allocated has some additional space at begining which causes this issue. ->ps | grep "/-ksh" | tail -1 | cut -f4... (2 Replies)
Discussion started by: lalitpct
2 Replies

9. Shell Programming and Scripting

Extract particular number from the command output

Hi Folks, I want to use particular number as a variable output..Please find the below for scenario... Example 1:- Below output i want to use secondary group 9003 as a variable output $ id -a |awk -NF '{print $3}' groups=99(local),9003(testadmin) Else I want to use 2006 as a... (8 Replies)
Discussion started by: susindram
8 Replies

10. Shell Programming and Scripting

Command to extract word from a string

Hi All, I have a word and from that word would like to search for certain set of string, is there any command to do so ? EX : Components from the above word, would like to search for strings set and extract the search string and then do if stmt... pon nen ent Com say... (2 Replies)
Discussion started by: Optimus81
2 Replies
BF_TAR(1)						    Bogofilter Reference Manual 						 BF_TAR(1)

NAME
bf_tar - shell script to write a tar file of a bogofilter directory to stdout SYNOPSIS
bf_tar [-r] [-R] bogofilter_directory DESCRIPTION
bf_tar bundles a bogofilter working directory in tar format and copies it to standard output (your console, or where you redirect it, see EXAMPLES below). OPTIONS
The -r option causes bf_tar to remove inactive log files after the archive has been written successfully. The default is to leave log files. The -R option causes bf_tar to remove inactive log files before the archive is written. This may reduce chances that the resulting archive is recoverable should it become damaged. The archive may be smaller though. The default is to leave log files. EXIT STATUS
The script exits with status code 0 if everything went well, and nonzero if it encountered trouble. EXAMPLES
o bf_tar ~/.bogofilter > outfile.tar Writes a standard .tar file containing the essential files from ~/.bogofilter to outfile.tar. o bf_tar ~/.bogofilter | gzip -9 -c > outfile.tar.gz Writes a gzipped .tar.gz file containing the essential files from ~/.bogofilter to outfile.tar.gz. o bf_tar `pwd`/mydirectory > outfile.tar Prepend $(pwd)/ or `pwd`/ if you want to specify an absolute path instead of a relative path. NOTES
This script is meant for use with Berkeley DB based bogofilter versions. This script requires a SUSv2 compliant pax utility. This script expects a SUSv2 compliant shell. Solaris systems should have the SUNWxcu4 package installed (when bogofilter is configured) so that /usr/xpg4/bin/sh can be used. AUTHORS
Matthias Andree Bogofilter 10/22/2012 BF_TAR(1)
All times are GMT -4. The time now is 02:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy