LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-24-2015, 10:14 AM   #1
sleftar
Member
 
Registered: Sep 2015
Posts: 50

Rep: Reputation: Disabled
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.
 
Old 10-24-2015, 10:15 AM   #2
sleftar
Member
 
Registered: Sep 2015
Posts: 50

Original Poster
Rep: Reputation: Disabled
Nevermind it assigns but does not show u need echo to show it.. I am sorry mods can close the thread..
 
Old 10-25-2015, 04:57 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,423

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pass command line arguments from one shell script to another shell script VijayaRaghavanLakshman Linux - Newbie 5 01-20-2012 10:12 PM
[SOLVED] Problem with rm command in shell script jdmResearch Programming 3 07-13-2011 11:41 AM
Problem executing mv command inside shell script pablogosse Linux - General 7 12-16-2009 01:21 PM
Shell-script should control a piped command -> PROBLEM waldese Linux - General 8 09-29-2006 04:27 AM
Problem with shell script using a variable from a unix command. abefroman Programming 1 05-10-2006 03:14 PM


All times are GMT -5. The time now is 11:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration