-1
votes
0answers
28 views

FreeBSD switch to user with nologin

I am running FreeBSD jails. i have a user i need to login as to run some commands. The user shell account is nologin. Without switching the users shell. or running su commands for each command i need ...
1
vote
1answer
87 views

Shell script to list locked packages in FreeBSD

I'm trying to make a oneliner to be able to list all locked (forbidden to upgrade) packages in FreeBSD. Normally, you issue this command: pkg info -ak It outputs list of all packages in system ...
0
votes
1answer
293 views

Command substitution in alias resolved in bash profile? [duplicate]

I want to make an alias for randomly changing my mac address alias chrandmac="sudo ifconfig en0 ether $(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//')" but the command substitution part is ...
3
votes
3answers
202 views

Bash port auto upgrading script in cron doesn't work properly?

I've been recently try to write a script to automate checks for new version of ports and software installed on my FreeBSD server. This script is added to root's crontab and fires daily. If I run it ...
2
votes
1answer
2k views

Can I run Bash scripts in FreeBSD without modifying them?

Correct me if I'm wrong: "sh" script != "bash" script Linux script are written in Bash Bash script usually #!/bin/sh In GNU/Linux, /bin/sh is Bash In FreeBSD, /bin/sh is not bash, it's the true sh ...
2
votes
1answer
2k views

How to Install BASH in FreeBSD

I really find that using bash helps a lot, when you need to retrieve strings of text that you used previously. But how can I install it on FreeBSD? I have tried typing bash into the terminal, but ...
1
vote
4answers
387 views

FreeBSD is not Unix. But its Unix-Like Unix. Where is then the main Unix to read the source code?

I want to really understand System V, the main origin of Unix (not Unix-like nor modified Unix to Linux). The main origin which is very confusing and not really with care its written somewhere. Is it ...
3
votes
3answers
169 views

Doing actions on a list from the shell

I have a list of packages I want to deinstall. The deinstaller program pkg_deinstall doesn't take a list of packages as parameter to deinstall. How would I deinstall from the list (like a foreach ...
4
votes
1answer
1k views

Bash: `-su: $*: unbound variable` with `set -u`

This is a FreeBSD 7.x system running GNU bash version 4.0. In Bash, the set -u option can force a shell to print an error if it encounters an unset variable, like this: $ set -u $ echo $THISISUNSET ...