LinuxQuestions.org
Register a domain and help support LQ
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 08-11-2016, 11:22 AM   #1
sakshisood
LQ Newbie
 
Registered: Aug 2016
Posts: 1

Rep: Reputation: Disabled
How to totally suppress Git Clone output?


I am writing a shell script wherein I am doing

log=/var/tmp/git_prod_test_pack/log.out
Time_clone=`(/usr/bin/time -f'%e' git clone --quiet ssh://id@xxxxxxxxxx) 2>&1 >> $log`
echo $Time_clone
It is giving output as Total 104 (delta 0), reused 104 (delta 0) 0.17

How can I totally suppress this output and get only 0.17 ?
 
Old 08-11-2016, 12:37 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,250

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Parameter substitution (##)
 
Old 08-11-2016, 12:50 PM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
You are redirecting stderr to the console, then redirecting stdout to the log. If you want both to go to the log, you need to do them in the other order.
 
Old 08-14-2016, 07:46 AM   #4
ondoho
Senior Member
 
Registered: Dec 2013
Posts: 4,176

Rep: Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835
Quote:
Originally Posted by smallpond View Post
You are redirecting stderr to the console, then redirecting stdout to the log. If you want both to go to the log, you need to do them in the other order.
Code:
... >> $log 2>&1
 
  


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
git clone: Git Protocol not working SnH Linux - Newbie 3 05-23-2013 03:29 AM
suppress all output suprstar Linux - Newbie 2 12-05-2011 10:47 AM
inconsistency issue of git-clone ***/git/mesa/drm with the existing kernel source centguy Linux - Desktop 2 10-08-2008 11:36 PM
how to suppress some of ls's output? BrianK Linux - General 2 03-03-2006 04:16 PM
Suppress Iptables' Output mrsolo Linux - Software 1 05-05-2003 09:45 PM


All times are GMT -5. The time now is 04:38 AM.

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