BSD is a family of Unix-like operating systems, including FreeBSD, NetBSD and OpenBSD.
Questions tagged [bsd]
510 questions
0
votes
2 answers
bash: query timestamp of UTC date on BSD
What I intent to get is
$ xxx 2019-10-11 <= insert your command
1570752000
The output is timestamp in Oct 11 00:00:00 UTC 2019. I find a good way to do this in gnu, but not in bsd

Justin Lin
- 673
- 1
- 6
- 15
0
votes
1 answer
Strange bash message when source-ing file
ql_get_latest(){
. "$BASH_SOURCE";
}
export -f ql_get_latest;
when I run bash, I drop into a shell:
and then when I run ql_get_latest I get:
bash: environment: No such file or directory
anybody know what that's about?
user5047085
0
votes
2 answers
How to show the first line of `top` non interatively?
top on Mac shows something like this on the top of the screen.
Processes: 1104 total, 187 running, 917 sleeping, 2761 threads 19:41:00
I don't want to run top interactively. Is there a…

user1424739
- 11,937
- 17
- 63
- 152
0
votes
1 answer
grep -v -f of empty file different between script and command line on OS X
In bash, in Terminal on my Mac, (but not in Linux), grep -v -f behaves differently depending on whether it's executed at the command line or in a script. From the command line:
$ touch empty-file #create an empty file
$ printf 'foo' | grep -v -f…

Ethan Herdrick
- 174
- 10
0
votes
1 answer
Bsd correction possible?
I am looking at using the BSD checksum described here at wiki BSD does anyone know if you can use it for basic error correction?

Chris James
- 151
- 2
- 14
0
votes
0 answers
How to determine the standard gateway address in C on BSD/OS X systems?
I'd like to get the IP address of the standard gateway on BSD/OS X systems.
That's a simple question, however, I have enormous difficulties getting an answer.
This post:
Getting gateway to use for a given ip in ANSI C already answered the…

j3141592653589793238
- 1,810
- 2
- 16
- 38
0
votes
0 answers
No such process (3) when not connected to a network (AF_ROUTE)
When I am connected to a network, I can send a struct rt_msghdr* to the kernel and receive a corresponding route. However, when I disconnect from the network and try to send the same route message header, the socket fails at send() with errno =…

TekuConcept
- 1,264
- 1
- 11
- 21
0
votes
1 answer
Multiple PID Files in newsyslog.conf
In the newsyslog.conf file you can define a PIDFile for each log file being rotated. What I'm wondering is can you define (2) two pid_files per logfile being rotated?
--
/var/log/file.log root:group 644 7 * $D0 GZ…

Alby
- 426
- 2
- 7
- 17
0
votes
1 answer
bash show for loop variable twice
Why does this only show the entry from data.csv one time?
for i in `cat ~/Downloads/data.csv`
do
echo $i $i
done
I have tried $i$i and the += operator and none of them seem to do what I would have expected. The goal is to create links from…

Scott C Wilson
- 19,102
- 10
- 61
- 83
0
votes
1 answer
Search variable for multiple substrings
Working on a BSD system and having difficultly searching a variable to see if it contains any of multiple different substrings. This is what I have that works:
> echo $lenck if test "${lenck#*$pattern1}" != "$lenck";
> then
> if…

Stem
- 3
- 3
0
votes
1 answer
Issue assigning a SED to a variable
I am working on a BSD machine and what I am attempting to do is assign a variable the output from a SED command that uses a variable as input. Been working on this for 3 days, tried multiple different things, and always end up with './subscript:…

Stem
- 3
- 3
0
votes
0 answers
Client software c/c++ socket multiple interfaces(bonding?)
Hardware: 1) Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)
2) Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)
OS : Linux mint Cinnamon …

Yurii Lampiha
- 1
- 2
0
votes
1 answer
Replace substring only in lines that match a pattern
How can I run a replacement in sed only when part of a line I don't want to replace includes one of a list of substrings?
For example, say, the substrings used to mark lines I want to replace are 123, 456 and abc in the following sample input:
#…

Chris
- 985
- 2
- 7
- 17
0
votes
2 answers
Control Memory of Java process via environment variables
I need to run a script that contains a call to java. I cannot change that script (as it must be run on a variety of machines), but I can change the environment around it.
I can run a wrapping script around it, if that helps.
My underlying problem is…

Angelo Fuchs
- 9,825
- 1
- 35
- 72
0
votes
0 answers
Unix interpretation of symlinks?
I'm working on hybrid semantic-hierarchical filesystem using FUSE and VFS-only interface. One of primary solutions to simplify i/o is to use symlinks in search results instead of actual files/ It also gets rid of i/o middleware.
While files are…

Lapsio
- 6,384
- 4
- 20
- 26