LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 10: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, 11:37 AM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,515

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

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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, 06:46 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 5,924

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

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

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