shell

  1. T

    Shell How to parse a text file?

    I am looking to parse a file for specific content that is on a line that always has a specific beginning, for example: "Program: code" I want to extract code on the line that starts with Program. I then want to add that extracted string into an already created file. Can anyone provide some...
  2. vermaden

    HOWTO: Ghost in the Shell - Part 4

    I would like to share HOWTO in Ghost in the Shell series about efficient working in the UNIX shell environment. Ghost in the Shell - Part 4 https://vermaden.wordpress.com/2019/03/15/ghost-in-the-shell-part-4/ Regards, vermaden
  3. V

    sh vi mode with command mode by default

    Hi! /bin/sh (Almquist shell) with vi mode (set -o vi) starts every new line at insert mode. So I must press Esc every new prompt if I want to go through history. Is it possible to start shell prompts with "vi command (normal) mode"?
  4. vermaden

    HOWTO: Ghost in the Shell - Part 3

    I would like to share HOWTO in Ghost in the Shell series about efficient working in the UNIX shell environment. Ghost in the Shell - Part 3 https://vermaden.wordpress.com/2018/09/15/ghost-in-the-shell-part-3/ Regards, vermaden
  5. takumi

    Image viewer for the console.

    Hi. I like to know, is there is a chance to see images, pdf, and videos on the console (no X running) with the framebuffer on FreeBSD like there is on my Gentoo with fbi, fbgs and mplayer. Looks like w3m (w3m-img) could show images, but is a project whit not update from a long time. Regards.
  6. vermaden

    HOWTO: Ghost in the Shell - Part 2

    I would like to share HOWTO in Ghost in the Shell series about efficient working in the UNIX shell environment. Ghost in the Shell - Part 2 https://vermaden.wordpress.com/2018/07/08/ghost-in-the-shell-part-2/
  7. Duffyx

    Shell Variables in a cron entry

    I'd like to define some local variables in a cron entry so that I can create the following file /usr/local/etc/cron.d/rsync with the following contents: PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin excludes="--exclude=/storage --exclude=/proc"...
  8. MaxRuse11

    Setting up TCSH

    I've got a Digital Ocean droplet running FreeBSD which I shell into. I can locate tcsh under /bin/tcsh but using setenv in my local .cshrc file doesn't cause this shell to be used on next login. Env reports the shell as sh and the prompt hasn't changed to > Editing master.passwd to use tcsh...
  9. ILUXA

    Shell Share your .zshrc file

    I like the way how tcsh works, but it is outdated a little bit (only 1 update since 2012), also some nice features are available in zsh, like suggesting flags and other completions for cli and not only cli apps… But some of its features are distracting and annoying IMHO. I didn't find any...
  10. A

    Solved Script not running from Cron

    Hello, I have that sh script: #!/bin/sh DATE=`date +%Y-%m-%d:%H:%M:%S` NAME="game" if ps ax | grep -v grep | grep $NAME > /dev/null then echo "$NAME service running, everything is fine" else echo "$DATE: Restarting $NAME" >> /root/log cd /usr/home/game/db && ./game fi and it works...
  11. JazzSinatra

    TTY, Shell, prompt, terminal?

    This is probably a noob question, but I have wondered for some time the difference between TTY and terminal like rxvt-unicode or Xterm (and less shell). Is TTY just a virtual device which runs terminal emulator like rxvt-unicode which runs shell like sh or bash? If I have a freshly installed...
  12. P

    Solved Remote execution via Ruby-SSH starts different shell

    Hello, we are using net/ssh in Ruby to execute scripts on a FreeBSD machine, in order to do some checks for Nagios. Actually it is a brand new Pfsense applicance. The code is roughly the following: Net::SSH.start(@host, @user, {:password=>@pass}) do |ssh| erg=ssh.exec! "ls -al" p erg end...
  13. csptra

    Solved perl regex

    Hello, I admit, I am not proficient with regex. I'm trying to match a pattern taken from the output of reformime. (see below). I am not having much luck. When I can get it to work, then it matches everything. I think this is due to the working pattern matching the longer pattern. Sample...
  14. D

    How to show a progress or percentage bar on script?

    Hi, I'm a student and I have to create a script, but I want to show a progress bar when the script is making a backup. For example, I'm making a full backup of the FreeBSD system and while the script is making the job, I want to show a progress or a bar percent completed, is that possible on...
  15. R

    Solved update-alternatives for FreeBSD

    Hello, when calling the gpg command I want gpg2 to be executed instead of gpg1. Both programs are installed. In Linux I used update-alternatives for that. What would be the equivalent in FreeBSD? Thank you.
  16. CleanCut

    Solved Why won't my "new-style" rc script start at boot?

    On pfSense 2.2.4 (FreeBSD 10.1), my custom init script filebeat_wrapper won't start at boot. According to rcorder it should start right after boot: # rcorder /etc/rc.d/* /usr/local/etc/rc.d/* (snip) /etc/rc.d/SERVERS /etc/rc.d/DAEMON /etc/rc.d/LOGIN /usr/local/etc/rc.d/filebeat_wrapper (snip)...
  17. P

    Shell problem in setting default editor to vim

    I am on FreeBSD 10.2-RELEASE-p14 FreeBSD 10.2-RELEASE-p14 #0: Wed Mar 16 20:46:12 UTC 2016 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 Installed vim through pkg install vim. My Current shell is: $ echo $SHELL /usr/local/bin/bash My .profile file is edited...
  18. c00kie

    Shell tar: Option --transform is not supported

    hi I'm dabbling with shell scripting a little and trying to get a backup script running on FreeBSD. #!/bin/csh NOW=$(date +"%Y-%m-%d-%H%M") FILE="example.com.$NOW.tar" BACKUP_DIR="/usr/home/andy/backups" WWW_DIR="/var/www/" DB_USER="user" DB_PASS="pass" DB_NAME="dbname"...
  19. J

    Solved 'Command not found' even with full path

    Hi, I'm an intermediate-level user of FreeBSD. I recently ran into a problem that I have been unable to solve. Basically, most (but not all) commands now return 'Command not found', even if I use the full path, which makes no sense to me whatsoever. The only thing I can think of that...
Top