commands with variable
hi,
how to assign the commands like ls ,find ,rm to variable in linux. for ex: i need to delete the log files automatically every day using crontab. |
Code:
var=$(command) |
hi,
thanks for reply.we got the following errors [root@ebs httpd]# c=$find . -name *.txt -bash: .: -n: invalid option .: usage: . filename [arguments] [root@ebs httpd]# |
could not understand what are you trying to do there.
If you have assign the result of a command to a variable please use the format specified by ghostdog74, put the whole command in the brackets, preceded by a $. |
All times are GMT -5. The time now is 07:19 AM. |