LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shell script command problem (https://www.linuxquestions.org/questions/linux-newbie-8/shell-script-command-problem-4175557038/)

sleftar 10-24-2015 09:14 AM

Shell script command problem
 
Hello everyone.. Just trying to write a shell script to send automated email of my gaming server log files every so often but i got stuck here

Code:

a=`ls ~/management/logs/DoNotStarveTogether | grep -c "chat_log"`
this does not assign the integer value to variable a.

but if i write it as

Code:

ls ~/management/logs/DoNotStarveTogether | grep -c "chat_log"
it prints out the value. Any help would be appreciated.

sleftar 10-24-2015 09:15 AM

Nevermind it assigns but does not show u need echo to show it.. I am sorry mods can close the thread..

grail 10-25-2015 03:57 AM

Glad you found your own solution :) Please mark as SOLVED from the Thread Tools above :)


All times are GMT -5. The time now is 02:51 AM.