Skip to content

Tag: shell

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…

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…

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…

shell linux don’t execute commande

I have this command and it works fine on shell. I want to run it with php but it does not work what i missed : edited : $arg=”arg1″; $arg2= “arg2”; after this change no error on output but still commande not executed edited : the original commande is like this : and i want to around th…

AWK with commands [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations. Closed 3 years ago. Improve this ques…

Linux bash ‘[: -ge: unary operator expected’ error

I tried this code and it gives many errors that could anyone help me to fix this problem please. Answer The source of the problem reported in the question is an empty decvalue as syme has already stated. Considering the purpose of the script, it seems you attempted to write a recursive function. For this reas…