Skip to content
Advertisement

Tag: bash

how to move Files to a folder using mv in bash with condotions?

I was writing this code to organize my downloads folder so it wouldn’t be messy. i want the files to be moved to their proper folder like for mp4 it should go to the Videos folder. but the code is not working I guess it’s from ‘if’ statement but i don’t know how to fix it because i’m quite new

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

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.

How can I combine the commands leave and say?

Is there a way to make use of the command leave and the command say (MacOS) to be notified by the built in voice system? I can do echo hello | say on the command line. leave outputs Time to leave! how can this output be piped to say once it appears? When I issue this command it’s just hanging.

How to convert a directory of XML files in to RRD Files

I need to restore rrd files from my exisiting xml files. So I have used following simple bash script. I could not execute following script due to this error, But I could restore files one by one. Can someone help me to solve this? Answer When you use: You will see that $i equals: /home/dump_xml/a.xml /home/dump_xml/b.xml You see, it contains

Advertisement