!yzBwvLxciGLIBHonQe:matrix.org

bash

111 Members
Discussions about Bash shell, scripting, etc.37 Servers

Load older messages


SenderMessageTime
10 Sep 2020
@ulfnic:matrix.orgUlfnic changed their display name from Ulfnic to Ulfnic[m].09:16:27
@ulfnic:matrix.orgUlfnic changed their display name from Ulfnic[m] to Ulfnic.09:19:30
@sidd_dino:matrix.orgSidd_Dino joined the room.10:14:04
@sidd_dino:matrix.orgSidd_Dino changed their profile picture.10:15:33
@sidd_dino:matrix.orgSidd_DinoHello o/13:20:13
@hadallen:matrix.orghadallen joined the room.19:38:54
@hadallen:matrix.orghadallenhi all, i'm a beginner when it comes to bash scripting but I am trying to do a semi-simple script to start learning19:41:29
@hadallen:matrix.orghadallenI want to parse my UFW log and pull out blocked IPs+destination port - counting occurrences and sorting IPs and ports by # of attempts19:42:23
11 Sep 2020
@kmmxdat:matrix.orgkmmxdat
In reply to @hadallen:matrix.org
hi all, i'm a beginner when it comes to bash scripting but I am trying to do a semi-simple script to start learning
use awk - easiest way
05:48:45
@kmmxdat:matrix.orgkmmxdatawk+sort+uniq05:50:09
@hadallen:matrix.orghadallenthanks for the idea 🙂 20:18:56
@hadallen:matrix.orghadalleni didn't use awk, but only because I don't have much (any) experience with it yet20:19:46
@hadallen:matrix.orghadallen
count_ip=$(echo $ip_array | tr ' ' '\n' | sort | uniq -c | sort -nr)
20:22:39
@hadallen:matrix.orghadallengives me a sorted list of each IP that connects and # of occurrences 20:23:17
@hadallen:matrix.orghadalleni'm just learning though, so i will look into awk and see how I could use that in this scenario too20:31:55
@numbersix:matrix.orgnumbersix joined the room.23:03:42
12 Sep 2020
@n0q:matrix.orgn0qimo, awk and sed are the most efficient ways to handle a lot of problems, but not using them is probably better if you're learning. It forces you to learn about and use a lot of other tools.00:45:38
@pozol:matrix.orgpozol joined the room.22:17:19
26 Sep 2020
@pedro:chat.weho.stpedro 12:44:07
17 Sep 2020
@ulfnic:matrix.orgUlfnic set a profile picture.15:38:21
@marzipan:synod.immarzipan left the room.20:34:29
18 Sep 2020
@sebhoss:matrix.orgsebhoss left the room.08:10:03
@picme:matrix.orgpicme joined the room.13:59:18
19 Sep 2020
@santimir:matrix.orgsantimir
  function name(){
  case $1 in 
    *.tar)
    echo "first set $1 "
    tar -xvf "$1"
    ;;
    *.tar.gz)
    echo "second set $1 "
    tar -xvfz $1
    ;;
    *.tar.bz2)
    echo "third set $1 "
    tar -xvfj "$1"
    ;;
    *)
    ;;
  esac
}
00:32:00
@santimir:matrix.orgsantimirany one sees the error?00:32:15
@santimir:matrix.orgsantimir *
  function
  case $1 in 
    *.tar)
    echo "first set $1 "
    tar -xvf "$1"
    ;;
    *.tar.gz)
    echo "second set $1 "
    tar -xvfz $1
    ;;
    *.tar.bz2)
    echo "third set $1 "
    tar -xvfj "$1"
    ;;
    *)
    ;;
  esac
}
00:32:55
@santimir:matrix.orgsantimir *
  function name(){
  case $1 in 
    *.tar)
    echo "first set $1 "
    tar -xvf "$1"
    ;;
    *.tar.gz)
    echo "second set $1 "
    tar -xvfz $1
    ;;
    *.tar.bz2)
    echo "third set $1 "
    tar -xvfj "$1"
    ;;
    *)
    ;;
  esac
}
00:33:36
@santimir:matrix.orgsantimirsorry for the edits something weird happened when pasting00:33:54
20 Sep 2020
@picme:matrix.orgpicmetry xvzf instead of xvfz and xvjf instead of xvfj07:41:52
22 Sep 2020
@kan_chan:matrix.orgkan_chan joined the room.06:49:33

There are no newer messages yet.


Back to Room List