r_bash – Telegram
501. @r_modelmakers
502. @r_MCFC
503. @r_lifeprotips
504. @legalcatadvice
505. @r_ComedyCemetery
506. @GnarMains
507. @r_AxieInfinity
508. @r_ExpandDong
509. @r_PewdiepieSubmissions
510. @cheerleadersbackup
511. @asexualityonreddit
512. @r_coys
513. @r_Animemes
514. @r_btd6
515. @r_freegamefindings
516. @ImaginaryPics
517. @CanalLixo
518. @catmemes_reddit
519. @r_combatfootage
520. @r_softwaregore
521. @r_fightporn
522. @r_pcmasterrace
523. @r_documentaries
524. @r_ItemShop
525. @r_SISwimsuitGirls
526. @r_gentoo
527. @WhatsWrongWithYourDog
528. @r_wasletztepreis
529. @r_adporn
530. @r_Ferrets
531. @BikiniMoe
532. @stardewvalley_en
533. @r_xboxone
534. @Windows11Group
535. @r_technology
536. @just_hmmm
537. @r_MashuKyrielight
538. @loliconsunite
539. @r_Pony_irl
540. @r_sdarksouls
541. @Chainsaw_Man_Topic
542. @CricketShitpost
543. @r_boxoffice
544. @r_climbing
545. @frontlinegirls
546. @r_unexpectedhamilton
547. @reddit_gif
548. @r_catgifs
549. @g4m3savisos
550. @r_turkeyjerky
551. @r_pornhubcomments
552. @Idiots_In_Cars
553. @r_til
554. @r_radiocontrol
555. @r_simpsonshitpost
556. @r_youtubehaiku
557. @WatchPeopleVim
558. @r_Gintama
559. @r_movieclub
560. @giveaway_gift
561. @r_hackintosh
562. @r_MinecraftMemes
563. @r_thinkpadsforsale
564. @r_wellthatsucks
565. @r_mild
566. @r_engrish
567. @r_holdmybeer
568. @miku_nakano_fandom
569. @uminekoreddit
570. @r_bitcoin
571. @r_greentext
572. @RealRacing3TG
573. @intensememes
574. @memes_Evangelion
575. @reddit_Dota2
576. @ShrineOfNino
577. @r_wow
578. @r_indianmemes
579. @r_channels_tifu
580. @anime_gifs_hub
581. @dailydankmemes
582. @MemeArea
583. @r_bapcsalescanada
584. @r_cursed
585. @r_China_irl
586. @r_nofap
587. @r_bolehland
588. @r_riscv
589. @imaginarylands
590. @r_AskReddit
591. @r_polandball
592. @r_usenet
593. @r_dalle2
594. @redditvideos
595. @loveforlandlords
596. @rickandmorty_en
597. @r_technope
598. @r_nootropics
599. @r_ShitpostXIV
600. @r_52book
601. @r_yesyesyesyesno
602. @r_deepintoutube
603. @r_IKEAhacks
604. @r_sweden
605. @IndiaSocialSubreddit
606. @r_greenandpleasant
607. @OurWorldTWD
608. @r_disneyvacation
609. @cutie_kittycats
610. @Mootivati0n
611. @r_onejob
612. @r_bash
613. @tnomod
614. @r_Ratorix
615. @r_youshouldknow
616. @r_Davie504
617. @streetmoe
618. @r_pics_redux
619. @r_ContraPoints
620. @animemaids_hot
621. @lostbackup
622. @Indiancelebs
623. @r_SuperSentai
624. @Octoberstrike
625. @r_djs
626. @r_catastrophicfailure
627. @r_devops
628. @r_lostgeneration
629. @r_Bertra
630. @r_shittyramen
631. @r_confidentlyincorrect
632. @r_CursedComments
633. @foxgirls_hot
634. @r_PoliticalMemes
635. @subgeniuschurch
636. @r_porn
637. @reddit_facepalm
638. @r_remotejs
639. @r_DaniDev
640. @AllTwitter
641. @r_books
642. @r_formula1
643. @r_fantheories
644. @rdataisbeautiful
645. @r_vim
646. @r_nosafetysmokingfirst
647. @Reddit_NBA
648. @anime_bikini_waifus
649. @rselfie
650. @r_frogs
651. @r_AmongUs
652. @r_Avicii
653. @FitAndNaturalbackup
654. @news756
655. @wallpapers_desktop_mobile
656. @r_dota2
657. @r_Maybe
658. @r_designporn
659. @r_apexlegends
660. @r_valorant
661. @r_Morocco
662. @moonshotcryptos
663. @admeme
664. @r_StarWarsMemes
665. @r_streetwear
666. @r_starterpacks
667. @r_publicfreakout
668. @COMPLETE_ANARCHY
669. @qt_reddit
670. @r_freefolk
671. @harrypotterbackup
672. @r_programmerhumor
673. @r_arknights
674. @EminemMemes
675. @r_evilbuildings
676. @r_piano
677. @r_magiarecord
678. @AzurLane_sub
679. @r_grandorder
680. @r_suicidewatch
681. @r_MadokaMagica
682. @soccermemer
683. @vfxbackup
684. @MoviePosterTG
685. @r_MWII
686. @r_Windows_Redesign
687. @r_WatchPeopleDieInside
688. @r_chemistry
689. @MarbleRacing
690. @r_malaysia
691. @dogecoin_reddit
692. @CallOfDutyMobile_reddit
693. @MSILaptops
694. @reddit_pride
695. @r_kochin
696. @r_mlp
697. @r_Unity3D
698. @sffpc
699. @r_gunners
700. @r_ClashOfClans
Using output from command(s) not as input for the next command(s), but AS the next commands. (For DNS lookups.)

Scenario:

I want to be able to immediately run DNS lookups (`host`) on modified output from another command that generates a list of FQDNs.

I have multiple FQDNs that I'm querying against for the generation of a custom hosts file.

E.g.

~$ ./generatehosts
host1.com
host2.com
host3.com
[...]
host1000.com


What I want to do is from that output get a list of IPs (preferably just to the right of the FQDN) the IPs they're associated with.

I noticed I can use \`sed\` to create:

~$ ./generate
hosts | sed s/^/host /
host host1.com
host host2.com
host host3.com
...
hosts host1000.com

But how do I turn the output into the commands I want to run?


I'm 100% sure there is a less hacky and awful way to do this, but it got me curious if this was even possible.

https://redd.it/xutryz
@r_bash
Prepend text to every line of multi-line output

Been a while since I've done this kind of thing in bash, and my google skills seem to be failing me at the moment.

I have a command that returns multiple lines of results. I'm writing a noscript using that command, and would like to prepend some text to each output line, then write it to a file.

The desired output should look like this:

pretext output1
pretext output2
pretext output3

what I'm currently doing that is wrong (or at least, not right enough) is:

echo 'pretext 'commandwithoutput >> outputfile.txt

which results in:

pretext output1 output2 output3

Is there a way to get the desired output in a one-liner without an intermediate step?

I feel like this is something I already know how to do and am having some end of the day brain fog.

https://redd.it/xuwivp
@r_bash
Batch noscript conversion to BASH

Hello everyone,

I recently had to retire my windows server that I was using to run some batch noscripts. One of them was used to create nfo files for my media server. I am not confident using bash, but I am hoping someone here can. Would someone please convert this noscript for me? Any help is greatly appreciated, and noscript is posted below.

@echo off
setlocal
for /r %%a in (.mkv .avi .mp4 .mov .wav .mpeg .mpg) do (
(
echo ^<?xml version="1.0" encoding="UTF-8" standalone="yes"?^>
echo ^<episodedetails^>
for /f
"tokens=1, delims=-" %%b in ("%%~na") do call :gennoscript "%%c"
echo ^</episodedetails^>
) > "%%~dpna.nfo"
echo %%~dpna.nfo

)
goto :eof

:gennoscript
set "n=%~1"
:gt
if "%n:~0,1%" == " " (
set "n=%n:~1%"
goto gt
)
echo ^<noscript^>%n:&=^&%^</noscript^>

https://redd.it/xuykj0
@r_bash
Getting Timestamps from a text file

I have some big text files with time stamps in the format hh:mm:ss. I want to get all this timestamps as a list in a shell noscript. Can someone help me?

https://redd.it/xva983
@r_bash
comma between files in a ls

It's the first time I'm doing a noscript and the goal I'm aiming is to put a comma between every file name listed in the result message of the ls command. I'm a transferred student in a course where every other students have 1+ year experience in programming but that's not my case, the teacher won't help me since it's basic. He said me to make a condition, and if the argument (the file name) is not the last, then type a comma, if it's the last filename, type a point. But I don't know how to make a condition, how to write something, just how to type a command in a .sh.

&#x200B;

To put everything in a nutshell the goal is to make a noscript that act like ls, by using the ls command bt after each filename there is a comma. I doubt there's a tutorial for that on the internet, I'm still looking for but that seems to be pretty difficult without help. Have a great day :)

https://redd.it/xvcc9x
@r_bash
Create json array from bash string

I have the following string in bash


"3.8,3.9,3.10"


&#x200B;

Is there a way using shell to convert it into a json array, i.e.

["3.8", "3.9", "3.10"\]


https://redd.it/xvgndg
@r_bash
How do I highlight all the content within multiple directories in a directory without highlighting the directories themselves? Then how do I move all highlighted content into a new directory?



https://redd.it/xvrgrz
@r_bash
Echo to another terminal without the echo present"

I have this command that echo to antoher screen.

tmux send-keys -t screen1 $"echo 'hello'" Enter

And whenever i do that i get both echo 'Hello' and hello

root:/# echo 'hello'

hello

Is there a possibility to only get hello?

Im Stuck been googling for hours...

https://redd.it/xvt4sr
@r_bash
Advanced if statements.

So this is a tough one.

Im trying to incorporate multiple if statements, Where only 1 if statement is executed.

But I need to be able to see wich parameter(if) it took. So i can better enhance it.

This is my code.

Currently it executes all ifstatements if they are true.

c=2
d=15
body=30

&#x200B;

if (( c >= 0 && c<= 3 && d >= 13 && d <= 30 && body >= 13 && body <= 30)); then
bash -c "echo 'Parameter 1 were taken'"
fi;

if (( c >= 0 && c<= 3 && d >= 5 && d <= 7 && body >= 18 && body <= 24)); then
bash -c "echo 'Parameter 2 were taken'"
fi;

if (( c >= 0 && c<= 6 && d >= 4 && d <= 6 && body >= 25 && body <= 30)); then
bash -c "echo 'Parameter 3 were taken'"
fi;

Backticks

So based on this post i've read that you should use || \

Should i Remove the fi and then statements and make it only as ONE "then" and "fi"?

How would i accomplish that when i want to know what parameter it took?

Help is appreciated.

&#x200B;

&#x200B;

&#x200B;

&#x200B;

&#x200B;

&#x200B;

&#x200B;

||||
|:-|:-|:-|
||||

&#x200B;

https://redd.it/xw6z11
@r_bash
cron delete command help

Hi all,

&#x200B;

I am running this manual command to delete a kubernetes pod

kubectl delete pod -n testing-namespace tunnel-displace-665121cf-8c71y
pod "tunnel-displace-665121cf-8c71y" deleted

I was wondering is there a way to set it up in a cron job noscript or one liner to delete it, bear in mind that the pods ending name '665121cf-8c71y' constantly changes when deleted and a new one is spun up.

https://redd.it/xwa1so
@r_bash
Help with recovering files in vim

I was working on a file in vim and I press :wq, I closed, but when I opened it again, I loaded stuff form some swap file (from 6 hours ago) so I lost all of my data.

I tried vim recover, but still, its loading only from the swap file from 6 hours ago.

Is there any way I can recover my data?

(Anything will work, like when I scroll up on my terminal, I can see prev data, but I does not go up to the point where I was working on my file, is there any way I can see my data this way atleatst?)

&#x200B;

Any help will be appreciated (I have to submit an assignment in 6hrs and all my data was on that file I lost)

https://redd.it/xwa0o1
@r_bash
Please how can I fix this Linux Bash related error?

For context, I am currently undergoing a Software Engineering program for full stack dev training, and I am currently exploring basics of shell with some questions to be answered at the end of my study of the basics and concepts. I am doing very ok with it considering my background in Computer Engineering, but a final question here has me stumped.

Question - Create a magic file school.mgc that can be used with the command file to detect School data files. School data files always contain the string SCHOOL at offset 0.

Below is the command I used on bash to key in the noscript into the file school.mgc

echo -e '0 string SCHOOL School data\n!:mime School' > school.mgc

But when the software program autochecker runs through my answer, I get the error msg below.

*\*\[Got\]*

*(0 chars long)*

*\[Expected\] 0-current\_working\_directory: text/plain 100-lets\_move: text/plain 101-clean\_emacs: text/plain 102-tree: text/plain 103-commas: text/plain 10-back: text/plain 11-lists: text/plain 12-file\_type: text/plain 13-symbolic\_link: text/plain 14-copy\_html: text/plain 1-listit: text/plain 2-bring\_me\_home: text/plain 3-listfiles: text/plain 4-listmorefiles: text/plain 5-listfilesdigitonly: text/plain 6-firstdirectory: text/plain 7-movethatfile: text/plain 8-firstdelete: text/plain 9-firstdirdeletion: text/plain fake\_school0: text/plain fake\_school1: text/plain file\_school0: School file\_school1: School file\_test0: inode/x-empty h\_school.mgc: application/octet-stream README.md: ... (2168 chars long)\**

&#x200B;

**I am assuming something is wrong with my noscript in school.mgc. Can someone please assist and point me in the right direction please?**

**Thanks.**

https://redd.it/xw8cdb
@r_bash
Looking for help with montage issues “montage: UnableToOpenConfigurefile” “montage: NoDecodeDelegateForThisImageFormat”
https://redd.it/xwk022
@r_bash
Docker writing to program STDIN after starting it up?

Hi! I'm trying to set up a docker container that runs a steamcmd server.

It's all working fine, the server is downloaded an executed correctly. But it's the first time that i stumble upon this roadblock.

The first time that the server starts it asks for an admin password - that cannot be set as an argument or environment variable - that it reads from stdin.

My startup.sh noscript looks like this

#!/bin/bash

echo "Starting"

steamcmd +runnoscript /server/steam-noscript.txt

start-server.sh -servername server

When the server starts it complains that no password could be read

LOG> Command line admin password: null
LOG> Enter new administrator password:
Exception in thread "main" ERROR: General ,
1665004316009> 10,911,614> java.util.NoSuchElementException: No line found

How can i write some password to the stdin before the process starts?

https://redd.it/xwmmb1
@r_bash
This media is not supported in your browser
VIEW IN TELEGRAM
arttime's v1.9.1 brings joy to sysadmins and power-users by enabling the use of arttime right after booting OS for the first time and installing zsh (i.e. in a very limited terminal environment). More denoscription and links in comment below.
https://redd.it/xwqgl0
@r_bash
Here’s a playlist of 7 hours of music I use to focus when I’m coding/studying. Post yours as well if you also have one!
https://open.spotify.com/playlist/3gk5HsGrGwKQTHinbuPgRE

https://redd.it/xwtbca
@r_bash
I trying to write a noscript that created a number of files, each containing facts about specific people

I’m trying to write a noscript where the expected result is a noscript that takes a file, reads the people names, and creates several files named “facts-PERSON.txt”, for example “facts-mari.txt”, “facts-ole.txt”.

Each of these generated files must contain:

*On the first line, the name of the person.

*Then, all “fact lines” that contain that persons’s name, one line per fact.

*On the last line, the number of facts about that person.

Basic example for "john" with filename "facts-john.txt": 

john
John has a farm.
Mari loves John.
In the last 10 years, John went to Sweden only once.
3

I have a file called filteredlist.txt with all the names, and a file called factlist.txt with all the fact about the people.

I have used:

for name in ‘cat filteredlist.txt; do touch — facts-$name.txt; done

To create files for each person, but I don’t know how to move the facts from the other file into the persons file and the word count at the end.

I have tried:

cat filteredlist.txt factlist.txt | grep -i -E $name >> facts-$name.txt

and

cat facts-$name.txt | wc -l $1 | awk '{print $1 - 1}'n >> facts-$name.txt

But they don’t work, they just work on the first name, not the rest.

https://redd.it/xx5h8i
@r_bash