Skip to content

How to get output of function_1 into function_2 in shell scripting?

Suppose output of funtion_1: Question 1: Mark :5: Question 2: Mark :1: Question 3: Mark :3: Suppose function_2 needs to extract integer from function_1 output to calculate total mark. How to give output of function_1 to funtion_2? Answer Try this code: FILE_NAME=marks.txt function_1() { echo $(grep “Mar…

Trouble redirecting an error in pipeline using Bash?

So I used this command to get all .conf files from /etc/. I want the output in total_size.txt and my errors in error.txt. My output looks good, but the errors won’t redirect to error.txt, they appear in my terminal: I don’t know what to do; I tried 2>> instead of 2> but it won’t wor…

How to do dynamic port forwarding using Ruby

How do I do SSH dynamic port forwarding on Ruby? I tried to use gems such as “net/ssh/socks” and “net/ssh/gateway”, but it looks like they are already outdated because I can’t even require them. All I need to do is run this shell command and receive the PID of this process. I also trie…

Searching a text file backwards from the end

I’m trying to find the string containing the substring in a text file by starting at the end. The file has tens of millions of lines. (The requirement is to read from End of the File. I cannot use sed/awk/grep etc) The below program does the job but it takes a long time. How can I make it run faster?

Why is Pip not working after upgrading Python to 3.8?

I was working on a 2D game using python 3.6.8 and pip3. Everything was working fine. Then i downloaded and installed python 3.8. Now, pip won’t work at all. These are the errors I am getting when running “pip3 install arcade”: PLEASE HELP, I would like to continue making my game. Answer The …

How to access local variables in remote server using ssh [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 3 years ago. Improve this question I am trying to access my local variable in remote server. Which command should I use. Ex. cm…