I've got a very ugly pipeline for analyzing web server logs (but nevermind the application; I've come across this in other scripts as well). I want to nicely comment the steps in the pipeline, but I can't seem to do it.
I know, for instance that in csh/sh/bash, a # begins a comment, and any subsequent \ or | will be ignored. I've tried playing with : but to little avail (I'm using bash v3.1).
Here's a sample of the pipeline:
Can you see why I might want to comment these steps?
I have a project where I have to use bzcat to uncompress a file and use that output as the data to run another program on.
I understand that you would do (bzcat filename.bz2 ! program name) but then how do you access that data in the c program??? Please help thanks (2 Replies)
Does anyone know how to answer this? I have tried many different commands, I just cant get it right.....
Search the file 'data' for all of the lines that contain the pattern 'unx122'
and put those lines in the file 'matches'. (2 Replies)
#! /bin/sed -nf
# Remove C and C++ comments, by Brian Hiles (brian_hiles@rocketmail.com)
# Sped up (and bugfixed to some extent) by Paolo Bonzini (bonzini@gnu.org)
# Works its way through the line, copying to hold space the text up to the
# first special character (/, ", '). The original... (1 Reply)
I must write a script to change all C++ like comments:
// this is a comment
to this one
/* this is a comment */
How to do it by sed? With file:
#include <cstdio>
using namespace std; //one
// two
int main() {
printf("Example"); // three
}//four
the result should be: (2 Replies)
Hi,
I am trying to calculate a few values using the below code but it dosent seem to be working.
for i in 1 2 3 4 5 6 7 8
do
j=`expr $i + 3`
x =`head -$j temp1|tail -1|cut -f24 -d","`
y =`head -$j temp1|tail -1|cut -f25 -d","`
c =`expr $x / $y`
echo "$c" >> cal_1
done
I am not... (4 Replies)
I need to read input from a file, and make sure nothing prints after column 72.
basically, ignore input after character 72 until the next newline character.
Any help is appreciated. I have been searching forever! (10 Replies)
Hello gurus - I must be missing something, or there is a better way - pls enlighten me
I'm on a Solaris 10 vm running the following pipeline to reduce some apache logs (actually lynx dumps of /server-status/ when threads are above a threshold) to a set of offending DDoS IP addresses.
awk... (10 Replies)
Hi
Can anybody please explain me the following script in detail
Value=`echo "if ( ${FACTOR} >= 1 ) {1}" | bc`
What does "{1}" mean to here ? (3 Replies)
Hello,
I am attempting to ssh to a server and run a set of commands on a remote set of servers. I am getting the following error below, I am thinking quotes may be the problem. This command works on the local machine in bash. Not when I ssh to a remote server. Basically the command should... (3 Replies)
Discussion started by: jaysunn
3 Replies
LEARN ABOUT LINUX
pid
pid(n) Tcl Built-In Commands pid(n)__________________________________________________________________________________________________________________________________________________NAME
pid - Retrieve process identifiers
SYNOPSIS
pid ?fileId?
_________________________________________________________________DESCRIPTION
If the fileId argument is given then it should normally refer to a process pipeline created with the open command. In this case the pid
command will return a list whose elements are the process identifiers of all the processes in the pipeline, in order. The list will be
empty if fileId refers to an open file that is not a process pipeline. If no fileId argument is given then pid returns the process identi-
fier of the current process. All process identifiers are returned as decimal strings.
EXAMPLE
Print process information about the processes in a pipeline using the SysV ps program before reading the output of that pipeline:
set pipeline [open "| zcat somefile.gz | grep foobar | sort -u"]
# Print process information
exec ps -fp [pid $pipeline] >@stdout
# Print a separator and then the output of the pipeline
puts [string repeat - 70]
puts [read $pipeline]
close $pipeline
SEE ALSO
exec(n), open(n)
KEYWORDS
file, pipeline, process identifier
Tcl 7.0 pid(n)