LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 09:14 AM   #1
sleftar
Member
 
Registered: Sep 2015
Posts: 51

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, 09:15 AM   #2
sleftar
Member
 
Registered: Sep 2015
Posts: 51

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, 03:57 AM   #3
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,007

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


Reply



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 09:12 PM
[SOLVED] Problem with rm command in shell script jdmResearch Programming 3 07-13-2011 10:41 AM
Problem executing mv command inside shell script pablogosse Linux - General 7 12-16-2009 12:21 PM
Shell-script should control a piped command -> PROBLEM waldese Linux - General 8 09-29-2006 03:27 AM
Problem with shell script using a variable from a unix command. abefroman Programming 1 05-10-2006 02:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:49 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
Open Source Consulting | Domain Registration