• bash script and grep

    From Rick Smith@1:105/10 to All on Wed Feb 1 07:44:02 2023
    Greetings All!

    I am trying to use a modified bash script from a fellow sysop to import msg areas into maximus bbs, I changed the particulars to my setup and left the rest alone. I get a grep error, I was hoping someone here could spot the error as grep is not my strong suit.

    here is the error running the script.

    Usage: grep [OPTION]... PATTERNS [FILE]...
    Try 'grep --help' for more information.

    (yes I typed help, did not help me)

    here are the two areas in the script calling grep

    cat /fido/etc/areas_fidonet | grep EchoArea | grep 1:105/81 |sort> $TMPFILE while read -r line
    do
    TAGLONG=`echo $line|awk {'print $2'}`
    TAGSHORT=`echo $line|awk {'print $2'}|sed s/FIDO_//`
    FILE=`echo $line|awk {'print $3'}`
    DESC=`cat backbone.na | grep $TAGLONG | awk '{$1=""; print $0}'|sed 's/\r$//'`



    ----
    Regards,


    Rick Smith (Nitro)

    ... BBSing is terminal
    --- GoldED+/LNX 1.1.5-b20220504
    * Origin: ----> Abacus BBS! --->>>>bbs.abon.us:2323 (1:105/10)
  • From Wilfred van Velzen@2:280/464 to Rick Smith on Wed Feb 1 17:05:22 2023
    Hi Rick,

    On 2023-02-01 07:44:02, you wrote to All:

    here is the error running the script.

    Usage: grep [OPTION]... PATTERNS [FILE]...
    Try 'grep --help' for more information.

    (yes I typed help, did not help me)

    here are the two areas in the script calling grep

    cat /fido/etc/areas_fidonet | grep EchoArea | grep 1:105/81 |sort> $TMPFILE
    while read -r line
    do
    TAGLONG=`echo $line|awk {'print $2'}`
    TAGSHORT=`echo $line|awk {'print $2'}|sed s/FIDO_//`
    FILE=`echo $line|awk {'print $3'}`
    DESC=`cat backbone.na | grep $TAGLONG | awk '{$1=""; print $0}'|sed
    's/\r$//'`

    I would place $TAGLONG inside double quotes here, just incase it's an empty string.

    Bye, Wilfred.

    --- FMail-lnx64 2.1.5.2-B20230114
    * Origin: FMail development HQ (2:280/464)
  • From Daniel Path@2:371/52 to Rick Smith on Thu Feb 2 14:39:48 2023
    Hello Rick,

    01 Feb 23 07:44, you wrote to All:

    Greetings All!

    I am trying to use a modified bash script from a fellow sysop to
    import msg areas into maximus bbs, I changed the particulars to my
    setup and left the rest alone. I get a grep error, I was hoping
    someone here could spot the error as grep is not my strong suit.

    here is the error running the script.

    Usage: grep [OPTION]... PATTERNS [FILE]...
    Try 'grep --help' for more information.

    (yes I typed help, did not help me)

    here are the two areas in the script calling grep

    cat /fido/etc/areas_fidonet | grep EchoArea | grep 1:105/81 |sort> $TMPFILE while read -r line do
    TAGLONG=`echo $line|awk {'print $2'}`
    TAGSHORT=`echo $line|awk {'print $2'}|sed s/FIDO_//`
    FILE=`echo $line|awk {'print $3'}`
    DESC=`cat backbone.na | grep $TAGLONG | awk '{$1=""; print $0}'|sed 's/\r$//'`

    haha. thats my script :)

    try: grep "1:105/81" or set it as a variable as in the original script ;)

    Regards,
    --
    dp

    telnet://bbs.roonsbbs.hu:1212 <<=-

    ... 3:38pm up 37 days, 17:43:33, load: 77 processes, 275 threads.
    --- GoldED/2 1.1.4.7+EMX
    * Origin: Roon's BBS - Budapest, HUNGARY (2:371/52)
  • From Rick Smith@1:105/10 to Daniel Path on Thu Feb 2 07:59:22 2023
    Greetings Daniel!

    Thursday February 02 2023 14:39, you wrote to me about an urgent matter!:

    * Forwarded from area 'LINUX-UBUNTU'
    Hello Rick,

    01 Feb 23 07:44, you wrote to All:

    Greetings All!

    I am trying to use a modified bash script from a fellow sysop to
    import msg areas into maximus bbs, I changed the particulars to
    my setup and left the rest alone. I get a grep error, I was
    hoping someone here could spot the error as grep is not my strong
    suit.

    haha. thats my script :)

    try: grep "1:105/81" or set it as a variable as in the original script
    ;)

    It worked thankyou! Is there a way to have maxmimus number the echo's instead of fidonet.echoname, or perhaps some way to scroll and select with arrow keys?


    ----
    Regards,


    Rick Smith (Nitro)

    ... Recipes..The bumper stickers of BBSing
    --- GoldED+/LNX 1.1.5-b20220504
    * Origin: ----> Abacus BBS! --->>>>bbs.abon.us:2323 (1:105/10)
  • From Wilfred van Velzen@2:280/464 to Daniel Path on Thu Feb 2 17:30:08 2023
    Hi Daniel,

    On 2023-02-02 14:39:49, you wrote to Rick Smith:

    cat /fido/etc/areas_fidonet | grep EchoArea | grep 1:105/81 |sort>
    $TMPFILE while read -r line do
    TAGLONG=`echo $line|awk {'print $2'}`
    TAGSHORT=`echo $line|awk {'print $2'}|sed s/FIDO_//`
    FILE=`echo $line|awk {'print $3'}`
    DESC=`cat backbone.na | grep $TAGLONG | awk '{$1=""; print
    $0}'|sed 's/\r$//'`

    try: grep "1:105/81" or set it as a variable as in the original script

    Strange... On my linux in bash these give the same result:

    # echo 1:1/1 | grep 1:1/1
    1:1/1

    # echo 1:1/1 | grep "1:1/1"
    1:1/1

    There is an alias for grep:
    alias grep='grep --color=auto'

    But that shouldn't make a difference. Maybe on ubuntu it's different?


    Bye, Wilfred.

    --- FMail-lnx64 2.1.5.2-B20230114
    * Origin: FMail development HQ (2:280/464)
  • From Daniel Path@2:371/52 to Rick Smith on Thu Feb 2 20:15:40 2023
    Hello Rick,

    02 Feb 23 07:59, you wrote to me:

    Greetings Daniel!

    Thursday February 02 2023 14:39, you wrote to me about an urgent
    matter!:

    * Forwarded from area 'LINUX-UBUNTU'
    Hello Rick,

    01 Feb 23 07:44, you wrote to All:

    Greetings All!

    I am trying to use a modified bash script from a fellow sysop to
    import msg areas into maximus bbs, I changed the particulars to
    my setup and left the rest alone. I get a grep error, I was
    hoping someone here could spot the error as grep is not my
    strong suit.

    haha. thats my script :)

    try: grep "1:105/81" or set it as a variable as in the original
    script ;)

    It worked thankyou! Is there a way to have maxmimus number the echo's instead of fidonet.echoname,

    it's up to you what you do with the script. if you want you can create numbers. in msgarea.ctl this line tells the name of the area: MsgArea <BLA>

    or perhaps some way to scroll and select
    with arrow keys?

    there is TORDO099.ZIP for example, but it is really unreliable on my config:

    "_Tordo_! The revolutionary
    File and Message area Changer
    for Maximus 3.xx!! Tree-like
    area listing, with lightbars for
    area selections!! Works Great!!
    MailWare! by Andrea Brancatelli
    (2:335/354 - Rage BBS)"


    Regards,
    --
    dp

    telnet://bbs.roonsbbs.hu:1212 <<=-

    ... 9:13pm up 37 days, 23:18:36, load: 79 processes, 281 threads.
    --- GoldED/2 1.1.4.7+EMX
    * Origin: Roon's BBS - Budapest, HUNGARY (2:371/52)
  • From Daniel Path@2:371/52 to Wilfred van Velzen on Thu Feb 2 20:22:50 2023
    Hello Wilfred,

    02 Feb 23 17:30, you wrote to me:

    Hi Daniel,

    On 2023-02-02 14:39:49, you wrote to Rick Smith:

    cat /fido/etc/areas_fidonet | grep EchoArea | grep 1:105/81
    |sort>> $TMPFILE while read -r line do TAGLONG=`echo
    $line|awk {'print $2'}` TAGSHORT=`echo $line|awk {'print
    $2'}|sed s/FIDO_//` FILE=`echo $line|awk {'print $3'}`
    DESC=`cat backbone.na | grep $TAGLONG | awk '{$1="";
    print $0}'|sed 's/\r$//'`

    try: grep "1:105/81" or set it as a variable as in the original
    script

    Strange... On my linux in bash these give the same result:

    # echo 1:1/1 | grep 1:1/1
    1:1/1

    # echo 1:1/1 | grep "1:1/1"
    1:1/1

    yes, macos confirmed.

    There is an alias for grep:
    alias grep='grep --color=auto'

    But that shouldn't make a difference. Maybe on ubuntu it's different?

    dunno, i don't have ubuntu here (because of these simple shitty things )
    :)

    Regards,
    --
    dp

    telnet://bbs.roonsbbs.hu:1212 <<=-

    ... 9:13pm up 37 days, 23:18:36, load: 79 processes, 281 threads.
    --- GoldED/2 1.1.4.7+EMX
    * Origin: Roon's BBS - Budapest, HUNGARY (2:371/52)