LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-01-2018, 10:18 PM   #1
vinodm41
LQ Newbie
 
Registered: Jun 2015
Posts: 3

Rep: Reputation: Disabled
Bash script issue


Bash script issue

Below is small part of bash script....this script pulls logs from another server thru SSH. Do you think there is some issue with this part of script. Although i am not scripting expert but i think.
Help is required.


Code:
sudo -u backup ssh ${serv} cat ""${fic}"" | gawk -v min=$dat_min -v max=$dat_max -F '|' 'BEGIN {dat_min=min;dat_max=max} {split($2,a," ");split(a[1],b,"-");split(a[2],c,":");date=b[1]" "b[2]" "b[3]" "c[1]" "c[2]" "c[3];date=mktime(date);if ((date>=dat_min)&&(date<=dat_max)){print $0}}'|fgrep -v 'additionnelles' >${tempFile}

Last edited by vinodm41; 01-01-2018 at 10:43 PM.
 
Old 01-01-2018, 10:33 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,664
Blog Entries: 6

Rep: Reputation: 2524Reputation: 2524Reputation: 2524Reputation: 2524Reputation: 2524Reputation: 2524Reputation: 2524Reputation: 2524Reputation: 2524Reputation: 2524Reputation: 2524
Please place your code snippets inside [CODE]...[/CODE] tags for better readability (not QUOTE tags). You may type those yourself or click the "#" button in the edit controls.

Is your script not doing what you expect? If so, please describe what you expect it to do and how the result you get differs from what is expected.

No one here can know with certainty what you are expecting the script to do, so all we can do really is guess what it should do and then guess again why it may not be working.

Please review the Site FAQ, especially the links in that page about how to ask a well formed question, so that others may provide help.
 
Old 01-01-2018, 10:47 PM   #3
vinodm41
LQ Newbie
 
Registered: Jun 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by astrogeek View Post
Please place your code snippets inside [CODE]...[/CODE] tags for better readability (not QUOTE tags). You may type those yourself or click the "#" button in the edit controls.

Is your script not doing what you expect? If so, please describe what you expect it to do and how the result you get differs from what is expected.

No one here can know with certainty what you are expecting the script to do, so all we can do really is guess what it should do and then guess again why it may not be working.

Please review the Site FAQ, especially the links in that page about how to ask a well formed question, so that others may provide help.
Script searching for example on remote system /root/abc/xyz/abc .log whereas on remote system there is no space before .log, so here script throws error file not found.
 
Old 01-01-2018, 11:14 PM   #4
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: Devuan
Posts: 554

Rep: Reputation: 155Reputation: 155
As Astrogeek has said, we need more information in order to help you. Please see the link in my signature for a guide on how to ask a well-formed question
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash Script Issue wildbi111 Programming 5 06-17-2016 02:22 PM
[SOLVED] Bash script issue kingston Linux - Newbie 10 10-07-2015 08:04 AM
FTP Bash script issue psudo Linux - Server 4 08-12-2013 04:30 PM
Bash script issue tibix00 Programming 22 07-21-2011 12:23 PM
[SOLVED] issue with variable in bash script angel115 Programming 4 08-21-2006 01:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:15 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