Sponsored Content
Top Forums UNIX for Advanced & Expert Users Passing resulted string name of a gzipped file as an argument to another piped tool Post 302941737 by Corona688 on Monday 20th of April 2015 02:31:02 PM
Old 04-20-2015
Doesn't work that way. It wouldn't have a real file name, in any case; it'd try to open a file and complain that it didn't exist.

A named pipe may be useful. It'll effectively be a file my_tool can open, but acts like a pipe written to by something else.

Whatever process opens it freezes, though, until something else opens it too. So the writing process has to open it in the background.

Code:
mkfifo filename.pcap

( exec gunzip < filename.pcap.gz > filename.pcap & )

./my_tool filename.pcap

rm filename.pcap


Last edited by Corona688; 04-20-2015 at 03:39 PM..
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Permissions - passing a file as the argument

this is the only way i can think of to do this but there must be a better way or else im gonna end up writing 200 lines of copy and pasting code. echo ' READ WRITE EXECUTE' own=$(ls -al $1 |cut -c2) if ($own==r) then first=yes else first=no endif echo $first Im writing a... (1 Reply)
Discussion started by: iago
1 Replies

2. Shell Programming and Scripting

passing Argument

Hi All, i have script like below.. echo "1) first option" echo "" echo "2) second option" echo "" echo "*) please enter the correct option" read select case $select in 1) echo "first option selected" ;; 2) echo "second option selected" ;; *) echo "please enter the correct... (4 Replies)
Discussion started by: Shahul
4 Replies

3. UNIX for Dummies Questions & Answers

view gzipped files with name file.gz.$DATE on a Solaris box (without unzipping first)

Hi Howto view gzipped files with name file.gz.$DATE on a Solaris box (without unzipping first) $ ls -lrt total 4477 -rwxrwxr-x 1 oracle dba 569745 Apr 4 19:45 4_person2profileCon.txt.gz.04.04.11* -rwxrwxr-x 1 oracle dba 3783 Apr 4 19:45... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

4. Shell Programming and Scripting

Passing varibles as a string argument ?

For example test.sh: test="teststring" cmd=$1 $cmd For some reason I'm NOT seeing "teststring" when I type: ./test.sh "echo $test" Any ideas on how to get around this? I've tried commands like: ./test.sh "echo $($test)" ./test.sh "echo '$test'" And many variations to no... (6 Replies)
Discussion started by: secops
6 Replies

5. UNIX for Dummies Questions & Answers

Getting directories resulted from Find in one file

Hi Need help for the following scenario. I am having two directories /tmp/a and /tmp/b. /tmp/a again has subdirectories /tmp/a/aa and /tmp/a/ab. I want to run a script from /tmp/b to search for a file user.lst in the folders /tmp/a/aa and /tmp/a/ab, if available, i want to make a file in... (3 Replies)
Discussion started by: sudeep.id
3 Replies

6. Shell Programming and Scripting

Argument passing

How to pass the alphabet character as a argument in case and in if block? ex: c=$1 if a-z ]] then echo "alphabet" case $1 in a-z) echo "the value is a alphabet" edit by bakunin: please use CODE-tags. We REALLY mean it. (9 Replies)
Discussion started by: Roozo
9 Replies

7. Shell Programming and Scripting

Passing an argument using alias to piped command

Hi. I'm trying to do a "simple" thing. grep -rls grepped_exp path | xgs where xgs is an alias to something like: xargs gvim -o -c ":g/grepped_exp" now the problem is that I want to pass the "grepped_exp" to the piped alias. I was able to do something like what I want without the... (4 Replies)
Discussion started by: hagaysp
4 Replies

8. UNIX for Beginners Questions & Answers

Creating file and passing argument to a command

Hi All, I am having command to run which will take argument as input file. Right now we are creating the input file by cat and executing the command ftptransfer -i input file cat >input file file1 file2 cntrl +d Is there a way I can do that in a single command like ... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

9. Shell Programming and Scripting

Passing sql file name as an argument

Hi all, I have a a file which contains an oracle query. If this file is pushed into a shell script such as the below, it of course works fine. #!/usr/bin/sh su - oracle -c 'sqlplus -s / as sysdba <<EOF @/home/cron/ORA/sql/T-ORA006-OracleSessions.sql exit; EOF . What i am after... (2 Replies)
Discussion started by: nms
2 Replies

10. UNIX for Beginners Questions & Answers

Passing a second argument

I am trying to pass a second argument like so: if ] then export ARG2=$2 else message "Second argument not specified: USAGE - $PROGRAM_NAME ARG1 ARG2" checkerror -e 2 -m "Please specify if it is a history or weekly (H or W) extract in the 2nd argument" fi however, it always goes... (4 Replies)
Discussion started by: MIA651
4 Replies
MC-TOOL(1)							     Utilities								MC-TOOL(1)

NAME
mc-tool - manipulate Mission Control accounts from the command line SYNOPSIS
mc-tool list mc-tool add PROFILE DISPLAY-NAME [PARAMETER-SETTINGS...] mc-tool add MANAGER/PROTOCOL [PARAMETER-SETTINGS...] mc-tool update ACCOUNT [PARAMETER-SETTINGS...] mc-tool display ACCOUNT DISPLAY-NAME mc-tool nick ACCOUNT NICKNAME mc-tool icon ACCOUNT ICON mc-tool show ACCOUNT mc-tool get ACCOUNT PARAMETER [PARAMETER...] mc-tool auto-presence ACCOUNT STATUS [MESSAGE] mc-tool request ACCOUNT STATUS [MESSAGE] mc-tool auto-connect ACCOUNT on|off mc-tool remove ACCOUNT DESCRIPTION
mc-tool's usage depends on its first argument (the "command") SPECIFYING ACCOUNTS Where an account name is needed, it may be given as a full object path (e.g. /org/freedesktop/Telepathy/Account/gabble/jabber/example), or as the unique account-specific suffix (e.g. gabble/jabber/example). SPECIFYING PARAMETER SETTINGS Many commands take arguments that represent Telepathy connection manager parameters (see the Telepathy Specification for details of these). Each argument has the following form: TYPE:NAME=VALUE where TYPE is either int, uint, bool, or string (other parameter types exist, but are currently unsupported by mc-tool), NAME is the name of the connection manager parameter (e.g. account or password), and VALUE is the parameter's value (with integers in decimal, and booleans as 0 or 1). The update command also accepts arguments of the form clear:NAME which delete the named parameter from the account configuration. LIST mc-tool list lists the available accounts. ADD mc-tool add adds an account. The connection manager and protocol can either be given as the name of a Mission Control profile, (e.g. gtalk), or as a slash-separated connection manager name and protocol (e.g. gabble/jabber). DISPLAY mc-tool display ACCOUNT DISPLAY-NAME sets the DisplayName property of ACCOUNT to DISPLAY-NAME. NICK mc-tool nick ACCOUNT NICKNAME sets the Nickname property of ACCOUNT to NICKNAME. ICON mc-tool icon ACCOUNT ICON sets the Icon property of ACCOUNT to ICON. SHOW mc-tool show ACCOUNT shows information about ACCOUNT. GET mc-tool get ACCOUNT PARAMETER [PARAMETER...] shows the values of the given parameters of ACCOUNT. ENABLE mc-tool enable ACCOUNT sets the Enabled property of ACCOUNT to True. DISABLE mc-tool disable ACCOUNT sets the Enabled property of ACCOUNT to False. AUTO-PRESENCE mc-tool auto-presence ACCOUNT STATUS [MESSAGE] sets the AutomaticPresence property of ACCOUNT to STATUS with optional message MESSAGE. REQUEST mc-tool request ACCOUNT STATUS [MESSAGE] sets the RequestedPresence property of ACCOUNT to STATUS with optional message MESSAGE; this is how you tell an account to connect or go offline, for example. AUTO-CONNECT mc-tool auto-connect ACCOUNT on sets the ConnectAutomatically property of ACCOUNT to True. mc-tool auto-connect ACCOUNT off sets it to False. Telepathy July 2009 MC-TOOL(1)
All times are GMT -4. The time now is 04:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy