Sponsored Content
Full Discussion: Proper syntax
Top Forums UNIX for Dummies Questions & Answers Proper syntax Post 302674283 by jrymer on Thursday 19th of July 2012 10:13:28 AM
Old 07-19-2012
Proper syntax

I'm new to Unix, and just had a quick question.

I'm writing a bash script, and I was wondering what proper programming etiquette was for piping. How many pipes is too many pipes?
Code:
OLDEST=$(find . -maxdepth 1 -type d -newermt 2012-07-01 ! -newermt
2012-07-30 | xargs ls -1td | tail -2)

echo "${OLDEST}\n"

My next step would be to tar those directories, then move them. I'm not asking if it's a matter of CAN I pipe it all, but SHOULD I pipe it all. As its proper to indent while in a loop, is there a unanimous rule for amount of pipes?

Thanks
 

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Proper Forum Etiquette

I'm a frequent visitor to these forums. I generally enjoy topics that are posted as well as the responses. I really pickup a lot of new things to learn. However, there is one thing that does bother me here. (I dont mean to start a flame war, or any problems at all, just expressing some... (8 Replies)
Discussion started by: tarballed
8 Replies

2. IP Networking

Proper routing

I have a series of new machines that are internet facing (have IP's that are accessible via the 'net) and it has internal facing interfaces. I need to be able to communicate back to the internal network to a specific server which processes monitoring and e-mail traffic. I've been told that I should... (3 Replies)
Discussion started by: BOFH
3 Replies

3. UNIX for Dummies Questions & Answers

Proper use of prune...

My goal was to find any directories inside of any directory called "09_Client Original" not modified in the last 30 days. $ find /Volumes/Jobs_Volume/ -type d -name "09_Client Original" -exec find {} -mtime +30 -type d -maxdepth 1 \; The results of this find are passed along in a perl script... (1 Reply)
Discussion started by: guriboy
1 Replies

4. Shell Programming and Scripting

getting proper o/p from a procedure in a script

foll. is my code snippet. #!/bin/ksh retVal=`sqlplus -s user/passwd@oracle_sid <<EOF SET SERVEROUTPUT ON SIZE 100000 DECLARE STATUS_VALUE CHAR; BEGIN SELECT temp1 INTO STATUS_VALUE FROM sai; DBMS_OUTPUT.PUT_LINE(STATUS_VALUE); END; / SET... (1 Reply)
Discussion started by: sainathdeg
1 Replies

5. Shell Programming and Scripting

proper ordering of o/p values

Hi, Below is my script which creates a file: #!/bin/sh if then echo "Enter bill period " echo "Syntax: sh cpd.sh G08" exit fi sqlplus uname/pwd@dbname <<EOF set WRAP off set FEEDBACK off set PAGESIZE 0 set VERIFY off (14 Replies)
Discussion started by: ss_ss
14 Replies

6. BSD

proper syntax of grep command

I'm learning UNIX on my mac (BSD), using a manual. I'm trying to figure out the grep command, and am getting something wrong. I've opened one of my files in NeoOffice and am looking for a string, the phrase 'I am writing.' I've been to some sites to get the proper syntax, and from what I can see... (5 Replies)
Discussion started by: Straitsfan
5 Replies

7. Shell Programming and Scripting

Help with proper loop and variables

I have written a Bash Script that captures video via the Linux application DVgrab. When run my script prompts the terminal user to enter all the necessary information for the capture, save location, file name, file type capture duration etc... These are all in the form of #!/bin/bash echo... (5 Replies)
Discussion started by: Starcast
5 Replies

8. UNIX for Dummies Questions & Answers

check file is a proper flv

Hello, On a linux server (centos 5.4), users upload file that should be flv. How can I check that the file is a real and proper flv file? Checking the extension is not enough! Thanks (1 Reply)
Discussion started by: JCR
1 Replies

9. What is on Your Mind?

Proper configuration management

Recently i started to work in new company. I will replace old admin who is going into retirement and he has been showing me his procedures for server, database and network administration. From first point of view: there is absolutely no configuration management involved how they deploy software... (0 Replies)
Discussion started by: solaris_user
0 Replies

10. Cybersecurity

Proper naming conventions

Hey guys, not sure should I post it here or in 'What is on Your Mind?' I'm discussing usage of DSL (domain specific language) in security tools with my colleagues. We haven't been able to reach an agreement over naming conventions. There are many tools using DSL: splunk, sumologic,... (2 Replies)
Discussion started by: Tobby P
2 Replies
POE::Pipe::OneWay(3pm)					User Contributed Perl Documentation				    POE::Pipe::OneWay(3pm)

NAME
POE::Pipe::OneWay - a portable API for one-way pipes SYNOPSIS
my ($read, $write) = POE::Pipe::OneWay->new(); die "couldn't create a pipe: $!" unless defined $read; DESCRIPTION
The right way to create an anonymous pipe varies from one operating system to the next. Some operating systems support "pipe()". Others require "socketpair()". And a few operating systems support neither, so a plain old socket must be created. POE::Pipe::OneWay will attempt to create a unidirectional pipe using "pipe()", "socketpair()", and IO::Socket::INET, in that order. Exceptions are hardcoded for operating systems with broken or nonstandard behaviors. The upshot of all this is that an application can portably create a one-way pipe by instantiating POE::Pipe::OneWay. The work of deciding how to create the pipe and opening the handles will be taken care of internally. POE::Pipe::OneWay may be used outside of POE, as it doesn't use POE internally. PUBLIC METHODS
new [TYPE] Create a new one-way pipe, optionally constraining it to a particular TYPE of pipe. One-way pipes have two ends: a "read" end and a "write" end. On success, new() returns two handles: one for the "read" end and one for the "write" end. Returns nothing on failure, and sets $! to explain why the constructor failed. my ($read, $write) = POE::Pipe::OneWay->new(); die $! unless defined $read; TYPE may be one of "pipe", "socketpair", or "inet". When set, POE::Pipe::OneWay will constrain its search to either "pipe()", a UNIX- domain "socketpair()", or plain old sockets, respectively. Otherwise new() will try each method in order, or a particular method predetermined to be the best one for the current operating environment. BUGS
POE::Pipe::OneWay may block up to one second on some systems if failure occurs while trying to create "inet" sockets. SEE ALSO
POE::Pipe, POE::Pipe::TwoWay. AUTHOR &; COPYRIGHT POE::Pipe::OneWay is copyright 2000-2008 by Rocco Caputo. All rights reserved. POE::Pipe::OneWay is free software; you may redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-05-15 POE::Pipe::OneWay(3pm)
All times are GMT -4. The time now is 08:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy