Skip to content

Tag: bash

Why does the file in a subdirectory not get copied?

I have to make a script which will copy all files from a certain location starting with “db.” to another location. My script works fine for all files which are directly in the directory, but it doesnt copy any files which are in subdirectorys. I have used the parameter -r, which should copy everyt…

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 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…

bash shell script for loop

I have a bash shell script that loops through a server list file to verify a user exists on that server. My question is, I want the script to echo out which servers the user exists on before executing command: sleep; clear; main_sec <(this is a function) problem is as soon as that condition is met, it just…

Loop to filter out lines from apache log files

I have several apache access files that I would like to clean up a bit before I analyze them. I am trying to use grep in the following way: I have several terms that I want to grep, so I am piping every grep action as follow: Until here my rudimentary script works as expected! But I have many apache