Skip to content
Advertisement

Tag: linux

Extract second word from a file in yum repository file using command line or bash

I wanted to extract a paticular file path from a text file (yum repository file) The file contents looks like this My requirement is to extract sslclinetkey path of both rhel-8-for-x86_64-appstream-rpm and rhel-8-for-x86_64-baseos-rpm through the command line or script Any help would be appreciated UPDATE I tried this way, but I am getting multiple entries But I only need of

Pipe into a shell/bash script from Web URL

How to download a script from URL, execute it, and pipe something into it – all with one command? I have a shell script to which I can pipe stuff: The script is moved to http://example.com/do-stuff.sh Try to do something like this: but it doesn’t work. Data does not get piped into the script. There is a workaround, but how

Node.js – Asynchronously edit JSON file and prevent interferance from other async calls

I am making a Discord bot in node.js, and need to store some per-guild data. I want to store it in separate JSON files in data/<guild.id>.json using the built in fs/promises. I have a function setGuildData(guildID: string, dataToAssign: object) that reads the current JSON file, parses the JSON to fileData, then assigns the new data using Object.assign() to finally stringify

I was trying to use conda env create command in amazon linux 2, it is taking forever at “Collecting package metadata (repodata.json): “

i had tried to run conda env create -f using miniconda and anaconda3 on an EC2 instance using Amazon linux 2, still it is taking forever at *Collecting package metadata (repodata.json): * , can anyone help me where i was going wrong, Thanks in Advance. Answer The issue was because of space (AFAIK), my EC2 instance was full of images

what alternative methods for sudo echo without bash -c

I must run the echo in the script my.sh with sudo because permission. I do not want to execute the script with sudo my.sh. I do not want to use bash -c “…” because escaping. Are there no other solutions? my.sh Answer The problem you are encountering here is that the output redirection >/file.tmp has to happen with elevated privileges.

Advertisement