storing the value of echo in a variable
Code:
#!/bin/bash Code:
#!/bin/bash I am getting the error "j command not found" . why is this error coming? How to solve this? |
There must not be spaces at both sides of the '=', try
Code:
j=$(echo $i) Code:
j=$i Also you must not put the text between 's, write Code:
for i in SOME LINUX COMMAND |
But the OP wrote `SOME LINUX COMMAND` (note the backticks)
It seems that he want to use the output of a command, by iterating through the output. Therefore the output is assigned to $i. I recommend not to use backticks but $(SOME LINUX COMMAND) instead in all cases where the output of a command is needed. For the sake of readability, backticks are confusing and can easily be overlooked. jlinkels |
All times are GMT -5. The time now is 03:01 PM. |