Sponsored Content
Full Discussion: Cat/File Descriptor Question
Homework and Emergencies Homework & Coursework Questions Cat/File Descriptor Question Post 302993033 by ayz649 on Monday 6th of March 2017 02:14:43 AM
Old 03-06-2017
Cat/File Descriptor Question

For the command below, I need to understand what exactly the command does and provide an examples for which the output will be saved to file save2... From my understanding, if the file provides an error in the first half of the pipe, it'll save to save1 and will never give an error to save to save2. I'm just confused as to what exactly would cause it to save anything to save2.

2. Relevant commands, code, scripts, algorithms:
Code:
cat 2>save1 0<memo | sort 2>save2 1>letter

Any help with this or if anyone can provide a tutorial that goes into examples using a combination of cat, pipes and file descriptors I would really appreciate it!


4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number:

Texas State University, San Marcos, TX, USA, Professor Quijun Gu, CS 4350

Moderator's Comments:
Mod Comment please use next time the full template, even if you believe to not enter in the orthodox form try your best, and dont forget to use for all code and data code tags , thanks

Last edited by vbe; 03-06-2017 at 03:59 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

File Descriptor Help

What is a file descriptor in Unix?? How to find a file descriptor of a file in Unix?? Does it have anything to do with the Inode numbers?? (3 Replies)
Discussion started by: rahulrathod
3 Replies

2. Programming

A small question about file descriptor

Can any body tell me when I put close(2), why the code does not show any out put? #include <stdio.h> #include <fcntl.h> #include <errno.h> int main(){ int fd1,fd2,fd3,fd4; close(2); fd1=open("test1.txt",O_WRONLY |O_CREAT | O_TRUNC,0744); fprintf(stderr,"fd1 = %d\n",fd1); ... (5 Replies)
Discussion started by: mlhazan
5 Replies

3. Shell Programming and Scripting

File Descriptor

Hello All, Im opening a file desciptor in perl and sending data using print CMD "$xyz". is there a limit to the length of the string that I can give to this CMD at a time. (3 Replies)
Discussion started by: rimser9
3 Replies

4. UNIX for Dummies Questions & Answers

File Descriptor

Hi What the below path contains? /proc/<pid>/fd (1 Reply)
Discussion started by: siba.s.nayak
1 Replies

5. Shell Programming and Scripting

Question regarding cat command

Hello Friends, I have a question, i am trying to write a shell script in the bash shell. #!/bin/sh NAWK=/bin/nawk AWK=/bin/awk FIX_XML_PATH=/home/administrator/testfix/fix/ Y=`ls $FIX_XML_PATH | grep xml` echo $Y cat $Y in this case when i do the echo $Y command it gives me the... (11 Replies)
Discussion started by: asirohi
11 Replies

6. OS X (Apple)

Question about cat and echo

Hello, I am trying to send text to a USB to serial adaptor and then to an external speech synthesizer. I tried using the cat and echo commands with no luck. I have gotten some audio output from my synthesizer using Kermit a terminal emulator, so I am pretty sure my synthesizer and my USB to serial... (1 Reply)
Discussion started by: jamesapp
1 Replies

7. Shell Programming and Scripting

Easy cat question

I am having problems getting a list of filenames that I want from a directory. example: I have 3 files - filename.xxx.20110505.123030 filename.yyy.20110505.123030 filename.zzz.20110505.123030 There may be multiple xxx,... (3 Replies)
Discussion started by: Drenhead
3 Replies

8. Shell Programming and Scripting

cat question

Can any one guide me how can i accomplish this by script i continuously receive files via our ftp server into a certain folder is there a way i can take those files cat it to a new file by hour and create a new file when new hour starts? (4 Replies)
Discussion started by: shehzad_m
4 Replies

9. UNIX for Dummies Questions & Answers

Question regarding Cat

Can we concatenate say, I have a few files prefixing with 2009... So now i want all the 2009 files into one single file.. Can this be achieved???? (4 Replies)
Discussion started by: saggiboy10
4 Replies

10. Shell Programming and Scripting

cat question

hello! why this works? cd /home/user cat * | ecasound -i stdin -o jack and this doesn't? cd /home/user/somedirectory cat * | ecasound -i stdin -o jack somedirectory are full with exe files which are the best source for this sort of noise thing (10 Replies)
Discussion started by: karlhungus
10 Replies
App::Prove::State(3pm)					 Perl Programmers Reference Guide				    App::Prove::State(3pm)

NAME
App::Prove::State - State storage for the "prove" command. VERSION
Version 3.26 DESCRIPTION
The "prove" command supports a "--state" option that instructs it to store persistent state across runs. This module implements that state and the operations that may be performed on it. SYNOPSIS
# Re-run failed tests $ prove --state=fail,save -rbv METHODS
Class Methods "new" Accepts a hashref with the following key/value pairs: o "store" The filename of the data store holding the data that App::Prove::State reads. o "extensions" (optional) The test name extensions. Defaults to ".t". o "result_class" (optional) The name of the "result_class". Defaults to "App::Prove::State::Result". "result_class" Getter/setter for the name of the class used for tracking test results. This class should either subclass from "App::Prove::State::Result" or provide an identical interface. "extensions" Get or set the list of extensions that files must have in order to be considered tests. Defaults to ['.t']. "results" Get the results of the last test run. Returns a "result_class()" instance. "commit" Save the test results. Should be called after all tests have run. Instance Methods "apply_switch" $self->apply_switch('failed,save'); Apply a list of switch options to the state, updating the internal object state as a result. Nothing is returned. Diagnostics: - "Illegal state option: %s" "last" Run in the same order as last time "failed" Run only the failed tests from last time "passed" Run only the passed tests from last time "all" Run all tests in normal order "hot" Run the tests that most recently failed first "todo" Run the tests ordered by number of todos. "slow" Run the tests in slowest to fastest order. "fast" Run test tests in fastest to slowest order. "new" Run the tests in newest to oldest order. "old" Run the tests in oldest to newest order. "save" Save the state on exit. "get_tests" Given a list of args get the names of tests that should run "observe_test" Store the results of a test. "save" Write the state to a file. "load" Load the state from a file perl v5.18.2 2014-01-06 App::Prove::State(3pm)
All times are GMT -4. The time now is 07:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy