Search Results

Search: Posts Made By: brsett
1,768
Posted By brsett
First that can't work. Dirname doesn't work the...
First that can't work. Dirname doesn't work the way you assume it does.

Second, I said I have a file, I can't change the contents of the file. The file is the file. I was trying to help you...
1,768
Posted By brsett
Using dirname on a file before uniq
Hello,

I have a list of files generated like this:

find dir -type f > file_list

I want to get a list of just the unique directories. I can't create a temporary file. So the idea is to...
4,593
Posted By brsett
Bash Passing An Array
Good grief so this should be easy. Passing an array as an argument to a function. Here is the sample code:


#/bin/bash

function foo {

local p1=${1}
local p2=(${2})
local p3=${3}
...
16,531
Posted By brsett
In a variable so that I can use it in a later...
In a variable so that I can use it in a later computation. This is all a huge script that uses ssh to do a bunch of remote work. I need a single remote invocation to print some junk to stdout, and...
16,531
Posted By brsett
Yeah, coprocs look like they would do it...
Yeah, coprocs look like they would do it perfectly. I'm just not certain if some of the older AIX systems will have a version greater than 4.0. Why doesn't this work:


read foo <<EOF &
$(p_w)...
16,531
Posted By brsett
I don't understand. It appears to me that nohup...
I don't understand. It appears to me that nohup just appends stdout to a file, nohup.out, which can't really work on my read only file systems. But maybe mkfifo is what I want . . .

The problem...
16,531
Posted By brsett
Capturing the output of a background job
Hello,

I unfortunately have a process that does two things, it returns an answer to me and then does a bunch of work that I would like to wait on. Here is a simple example:


#!/bin/bash
...
11,742
Posted By brsett
Functions, exit, and kill in bash
Hello

Okay, for reasons related to sourcing a script from another script, I've had to put my main loop into a function, and from there I call other functions. My problem then is exiting from...
14,888
Posted By brsett
ssh, bash, and /dev/stderr: no such device
Hello,

When I run the following program:


ssh 192.168.1.4 bash -l <<EOF
> echo foo >/dev/stderr
> EOF


I get the following confusing error.

bash: line 1: /dev/stderr: No such...
4,419
Posted By brsett
When moving data in XFS file systems (using...
When moving data in XFS file systems (using custom software), I can drive the disk arrays harder with non-buffered I/O, thus I like to open with O_DIRECT. That is, direct I/O is *way* faster in this...
4,419
Posted By brsett
Testing for O_DIRECT support
Is there some was to test if opening with the O_DIRECT flag will work (without writing a C program)?
2,068
Posted By brsett
Multiple lines combined into one for netstat (or ls)
Hello

So I understand when I do the following


used_ports=$(netstat -nat |cut -d : -f 2 |cut -d ' ' -f 1)


that the output will look like this


Active Proto 5298 22 631 55012 56093...
2,024
Posted By brsett
<deleted> I misread part of your response.
<deleted> I misread part of your response.
2,024
Posted By brsett
Great thanks. I know you meant to write: ...
Great thanks. I know you meant to write:


function exit() {:;}
source file
unset -f exit


Appreciate the help.
2,024
Posted By brsett
Trapping exit and continuing
Hello

I need to source a script. But that script terminates with a trailing exit. Which exits my script. I'm using bash, and this doesn't work:


trap 'echo disabled' EXIT
source...
1,826
Posted By brsett
Yeah, there is no route without a destination...
Yeah, there is no route without a destination endpoint.

I don't think multiple routes should matter, UNIX will use the first valid entry in the routing table. I want the interface used to get...
1,826
Posted By brsett
I don't know why I need the socket, I just need...
I don't know why I need the socket, I just need the route. On modern Linux I can do the following as it turns out (just learned this):

/sbin/ip route get <remote_ip>

And it is in that output. ...
1,826
Posted By brsett
Determining interface to access IP
Hello

I've got a server with multiple NICS. In a script I want to log the outbound interface. Is there an easy way I can do this so that the output looks something like this:
...
2,325
Posted By brsett
Thanks, that's got it fixed.
Thanks, that's got it fixed.
2,325
Posted By brsett
Escaping ** correctly
Hello

This should be easy, but bash is giving me headaches.

At the command line the following command works:


duplicity --include /home --exclude '**' / file:///foo


Doing that...
Showing results 1 to 20 of 20

 
All times are GMT -4. The time now is 09:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy