what is lighter on the system, variable calls, or full path in BASH script?
example:
Code:
#!/bin/bash Code:
#!/bin/bash |
in case you want to copy 30-40 files (or less than a few thousands) it does not matter at all.
variables are used to write better scripts (which can be handled easier) |
variables are stored in ram.
|
Quote:
if it really does not matter, then ill leave it in simple plan text without creating any functions, or what not. Thank you both. |
I think it really does not matter, copying files will take much more time
__________________________________ Happy with solution ... mark as SOLVED If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post. |
The variable expansion is only performed once on the call to copy, it doesn't matter how many files are actually copied. If you're only calling the copy 30-40 times, then you're only doing the variable expansion 30-40 times, and it will have no effect on the speed of the process. If this was inside a high speed loop that was iterating thousands/millions of times in a matter of seconds, then it might start to make a difference, but the copy itself will use FAR more time than the variable expansion in this case, so it'll make no practical difference.
|
fantastic, thanks all.
|
All times are GMT -5. The time now is 03:54 PM. |