bash shell script

  1. C

    chown in CUPS backend

    Hi guys! I am quite new to FreeBSD. I have some questions about setting up my own backend for CUPS. The goal is to save the incoming print job into a PDF on a directory and change the owner of the created PDF file to the user sending the print job. My current progress looks something like this...
  2. SoBe

    #!/bin/sh how to save a shell command output into a string variable

    Hello fellow freeBSD forum members, Can you please help Is there anyway to save the following into a variable? What I would like to do is check to see if this output is != null when true adjust some LEDS The following does not function as expected: #!/bin/sh str=`pfctl -vvss | grep ‘...
  3. Sergei_Shablovsky

    How to flash LEDs on copper ETH RJ-45 NIC's port by shell script?

    Hi, FreeBSD Gurus! How to flash LEDs on copper ETH RJ-45 NIC's port by shell script? I need to physically identify certain port on back of my servers with a lot of NICs each of them have 2-4 ETH ports. For now I find this solution (on StackExschange, not tested) but may be You propose a much...
  4. patpro

    Solved bash oddity on FreeBSD with version 5.1 and beyond

    Hello, I'm currently trying to test borgwarehouse.com to make sure it can get installed and ran properly on FreeBSD. It's very early stage software but sounds promising. Anyway, the software relies on a handful of bash shell scripts that could be ported to FreeBSD in no time. One of those shell...
  5. F

    Solved Automatically add my SSH keys for remote connection upon startup

    I'm running FreeBSD 13.1 as a VM that I use to learn and work on project. I would like to automatically add my ssh key to the ssh-agent. I've create the following bash script to run on demand: I then chmod +x to my file and can execute it. After typing my passphrase it looks like it is all...
  6. First_Law_of_Unix

    How to automatically execute commands that require "su" privileges during user login.

    Hello, I couldn't find any information from the web on how to make a shell script which can automatically execute commands that require "su" privileges during user login. I have read that I can store the shell script at "/etc/profile.d/" location which did not exist by default and I had to...
  7. byrnejb

    Shell bash trace / debugging does not seem to display the script line

    FreeBSD-12.3p5 GNU bash, version 5.1.16(0)-release (amd64-portbld-freebsd12.3) I am working on a bash script and I wish to trace the execution to locate a problem. The default shell for the development user is also bash. I am invoking the script from the command line using: export PS4="Line...
  8. byrnejb

    Solved What causes the premature end of a bash script?

    freebsd-version 12.3-RELEASE-p5 I have a bash script with a function that contains the following code: . . . OPT_t=0 . . . t) let "OPT_t+=1" ;; . . . f_msg_attach() { local _passed_msg_file _passed_attach_file _passed_content_type _passed_msg_file="$1"...
  9. Sergei_Shablovsky

    Bash script to automate installing bunch of packages

    Dear FreeBSD Gurus! Please share bash script to automate installing bunch of packages without any user interaction in a process. Let me write a little bit of details what I need exactly: pkg_autoinstaller_list.txt - text file that contain name of packages that I would to install. Each name in...
  10. byrnejb

    Solved Get the IP address of all sshd connections.

    I am looking for a reliable way of getting the IP origin of all pts sessions. The lastutility would be perfect other than it prints the host name and not the ip address. And I cannot see any way to force it to print the numeric address instead. Is there something similar that will? A: I...
  11. blind0ne

    Shell What is the best practice to learn SHELL/BASH

    Hello, I would like to know how to learn shell/bash scripting to do evryday tasks of iterating lists and parsing files. I have access to both linux and freebsd machines, and I would like to know all diferences in both sh in freebsd and these bash in linux. Is there anything good on the web? For...
  12. Basil Hendroff

    Shell Handling of special characters in variables

    Letcl is a Linux shell script that checks Let's Encrypt certificates issued for a domain. I've managed to modify it to run on FreeBSD and FreeBSD embedded systems like FreeNAS. The commands the script uses that are syntactically different between Linux and FreeBSD platforms are date and sed. For...
  13. Allan

    Best Practice Advice - Install script and config variables

    I'm attempting to script (bash) the post installation settings of FreeBSD. I'm trying to programmatically write the settings to /etc/rc.conf, /boot/loader.conf, /etc/sysctl.conf, /etc/devfs.conf, etc. just to name a few. I'm even trying to programmatically create .profile and other skeleton...
  14. Sergei_Shablovsky

    How to see which NIC is installed in which PCI slot by script ?

    Hi, FreeBSD guru! Is it possible at all to see which NIC is installed in which PCI slot by script ? As I know this may be something near the dmidecode and pciconf commands. But interesting to determine which exactly motherboard PCI slot are used for which NIC. I know that different...
  15. M

    Shell Bash escape and command substitution

    Dear All, I have a hard struggle with understanding how it works. From the bash manual and from Command Substitution: I have two commands from the Advanced Bash-Scripting Guide, which I can not understand how echo `echo \\z` 1) From shell operation 2. point it breaks tokens first...
Back
Top