Problem with 2>&1

19 views
Skip to first unread message

Pradnya Kiri Taksande

unread,
Aug 27, 2019, 11:28:33 AM8/27/19
to ns-3-users
Hello there,

The below statement can be used to save all the log statements in the file log.out.
./waf --run scratch/file_name > log.out 2>&1

Is there a requirement for using this "2>&1" for saving the log statements in a file?
For instance, does it need some package or something ?
It is working on some machines and not on others.

Thanks,
Pradnya

fordev user

unread,
Aug 27, 2019, 11:38:21 AM8/27/19
to ns-3-users
Hello,
try this :
./waf --run scratch/file_name 2> namefile.log

Pradnya Kiri Taksande

unread,
Aug 27, 2019, 11:58:35 AM8/27/19
to ns-3-...@googlegroups.com
Hello,

Thanks for the prompt reply.
But this " /waf --run scratch/file_name 2> log.out "  did not work.

With "./waf --run scratch/file_name > log.out 2>&1" ,
the 'std::cout' statements were getting saved in log.out, but with the suggestion given by you even these statements were not
not getting saved in log file and the log file turned out to be empty.

I want all statements including 'std:cout' as well as 'NS_LOG_INFO' statements to be saved in the log file.

Thanks,
Pradnya 


--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/F9dceXliqKg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/f145b767-f524-4598-b3cc-4d0888c5d5bb%40googlegroups.com.

fordev user

unread,
Aug 27, 2019, 12:00:10 PM8/27/19
to ns-3-...@googlegroups.com
Hello, 

You tried .txt?

You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ns-3-users/CAOb8rYMt69QYYkYzDQg%3Dg_pNktzhOM0cExrMdJhiThX%3D%3DOkksQ%40mail.gmail.com.

Pradnya Kiri Taksande

unread,
Aug 27, 2019, 1:24:56 PM8/27/19
to ns-3-...@googlegroups.com
I tried .txt, .out and .log all three. 
None of them seem to work.

Thanks,
Pradnya


Pradnya Kiri Taksande

unread,
Aug 27, 2019, 1:34:27 PM8/27/19
to ns-3-users
Forgot to mention, I am using ns3.26.

Thanks,
Pradnya

fordev user

unread,
Aug 27, 2019, 2:31:09 PM8/27/19
to ns-3-...@googlegroups.com
Ah sorry for that i'm not sure i will search for it 

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.

Pradnya Kiri Taksande

unread,
Aug 27, 2019, 2:42:50 PM8/27/19
to ns-3-...@googlegroups.com
What is the basic logic for 2>&1 ?
Why this simple statement will write the logs in a file ?
Just curious.

Thanks,
Pradnya 

fordev user

unread,
Aug 27, 2019, 2:51:11 PM8/27/19
to ns-3-...@googlegroups.com
For this statement i dont know it sorry   i'm also beginner

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.

Pradnya Kiri Taksande

unread,
Aug 28, 2019, 1:53:16 AM8/28/19
to ns-3-users
Hello there,

Is it OS dependent ?
In machine with ubuntu 16.04 it is working, but not on machines with older versions of ubuntu.

Thanks,
Pradnya

Pradnya Kiri Taksande

unread,
Aug 28, 2019, 9:56:11 AM8/28/19
to ns-3-users
Hello,

I re-installed ns3.26 with "--enable-examples --enable-tests" and it worked  :)

Thanks,
Pradnya

fordev user

unread,
Aug 28, 2019, 9:58:10 AM8/28/19
to ns-3-...@googlegroups.com
it was problem version?

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.

Craig Dowell

unread,
Aug 28, 2019, 8:58:03 PM8/28/19
to ns-3-...@googlegroups.com
Google is your friend.  The first thing it finds for 2>&1 is:

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.

Pradnya Kiri Taksande

unread,
Aug 29, 2019, 6:23:28 AM8/29/19
to ns-3-users
I think "--enable-examples --enable-tests" while installing solved the problem.

Thanks,
Pradnya


On Wednesday, August 28, 2019 at 7:28:10 PM UTC+5:30, fordev user wrote:
it was problem version?

Le mer. 28 août 2019 à 15:56, Pradnya Kiri Taksande <pragn...@gmail.com> a écrit :
Hello,

I re-installed ns3.26 with "--enable-examples --enable-tests" and it worked  :)

Thanks,
Pradnya

--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages