03-05-2004
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Can anyone please help me: i'm trying to read a file with directory-names , then go to that directory and read another (output) file to perform some tasks per line (second read line in the part of script below).
The problem is that after the nested while loop has finished, the first while... (7 Replies)
Discussion started by: Rakker
7 Replies
2. Shell Programming and Scripting
Please don't laugh or call me a fool...
I'm trying to set up a script that will go through my Music File directory and generate a set of symbolic links in a directory called "What's New". Within that directory there will be a "30 Days", "3 Months", "6 Months" and "A Year" directories. Within... (0 Replies)
Discussion started by: deckard
0 Replies
3. Shell Programming and Scripting
Hi -
Trying to take a list of ldap suffixes in a file, run an ldapsearch command on them, then run a grep command to see if it's a match, if not, then flag that and send an email alert.
The list file (ldaplist) would look like -
***********
o=company a
o=company b
***********
**... (7 Replies)
Discussion started by: littlefrog
7 Replies
4. Shell Programming and Scripting
I need help getting over this bump on how nested for loops work in shell. Say i was comparing files in a directory in any other language my for loop would look like so
for(int i=0;to then end; i++)
for(int y = i+1; to the end; y++)
I can't seem to understand how i can translate that... (5 Replies)
Discussion started by: taiL
5 Replies
5. UNIX for Dummies Questions & Answers
Hi all!
I'm really hoping you can help me out here; now i have searched and searched and have at least worked out that you can't have a nested if statement with a 'done' in it (as i have) as you're killing the parent before the child.
So here's what i have, and here's hoping someone can help... (2 Replies)
Discussion started by: dalgibbard
2 Replies
6. UNIX for Dummies Questions & Answers
Hi experts,
I just want to know if there is a better solution to my nested while read loops below:
while read line; do
while read line2; do
while read line3; do
echo "$line $line2 $line3"
done < file3.txt
done < file2.txt
done < file1.txt >... (4 Replies)
Discussion started by: chstr_14
4 Replies
7. Shell Programming and Scripting
Hi,
I have to assign a value for a varaiable based on a Input. I have written the below code:
if
then
nf=65
elif
then
nf=46
elif
then
nf=164
elif
then
nf=545
elif
then
nf=56
elif
then (3 Replies)
Discussion started by: machomaddy
3 Replies
8. Shell Programming and Scripting
hi I keep getting an error with this nested if statement and am getting the error unexpected end of file, can anyone help me as to why this wont execute?
#!/bin/bash
#script to check wether the -i -v statements run correctly
removeFile ()
{
mv $1 $HOME/deleted
}... (3 Replies)
Discussion started by: somersetdan
3 Replies
9. Shell Programming and Scripting
Hi,
i m trying to create script which logic is like below.
if ; then
x=`cat /tmp/testoutput.log | grep STOP | wc -l`
y=`cat /tmp/testoutput.log | grep RUN | wc -l`
if ; then
echo "process stop"
if ; then
echo "process running "
else
echo "file not found"
fi
----------------... (2 Replies)
Discussion started by: tapia
2 Replies
10. UNIX for Dummies Questions & Answers
I am having a problem with a nested if. I am sure I am overlooking something. I check for the existence of $Pidfl3 and it exists, o this condition I then want to check for the existence of a next file and remove it. The first if is executed, but on the second if I get test: argument expected.
My... (4 Replies)
Discussion started by: Charles Swart
4 Replies
SNP(4) BSD Kernel Interfaces Manual SNP(4)
NAME
snp -- tty snoop interface
SYNOPSIS
#include <sys/snoop.h>
int
ioctl(fd, SNPSTTY, &dev);
int
ioctl(fd, SNPGTTY, &dev);
int
ioctl(fd, FIONREAD, &result);
DESCRIPTION
/dev/snp is a snoop device which allows users to attach to any tty and watch activities on it. The kernel must be compiled with device snp,
or the snp module must be loaded, for these devices to be available.
To associate a given snp device with a tty to be observed, open the snp device and a tty device, and then issue the SNPSTTY ioctl on snp
device. The argument passed to the ioctl(2) is the address of a variable of type int, holding the file descriptor of a tty device. To
detach the snp device from a tty use a pointer to a value of -1.
The SNPGTTY ioctl returns information about the current tty attached to the open snp device.
The FIONREAD ioctl returns a positive value equal to the number of characters in a read buffer. Special values defined are:
SNP_OFLOW device overflow occurred, device detached.
SNP_TTYCLOSE tty not attached.
SNP_DETACH snp device has been detached by user or tty device has been closed and detached.
SEE ALSO
pty(4), sio(4), kldload(8), watch(8)
HISTORY
The snp device first appeared in FreeBSD 2.1. In FreeBSD 8.0 the snp driver was rewritten to work with the replaced TTY subsystem.
AUTHORS
The author of the current implementation is Ed Schouten <ed@FreeBSD.org>. Previous versions of snp were based on code written by Ugen J.S.
Antsilevich <ugen@NetVision.net.il>.
BUGS
This version of snp does not return proper error codes when calling FIONREAD. It also does not allow SNPSTTY to detach itself from the TTY.
BSD
November 5, 2008 BSD