- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I'm just wondering if there is a way to source setvars.sh while suppressing any output. Currently sourcing that gives the following
[login shell]
:: initializing oneAPI environment ...
-bash: BASH_VERSION = 4.4.20(1)-release
args: Using "$@" for setvars.sh arguments:
:: advisor -- latest
:: ccl -- latest
:: clck -- latest
:: compiler -- latest
:: dal -- latest
:: debugger -- latest
:: dev-utilities -- latest
:: dnnl -- latest
:: dpcpp-ct -- latest
:: dpl -- latest
:: inspector -- latest
:: intelpython -- latest
:: ipp -- latest
:: ippcp -- latest
:: ipp -- latest
:: itac -- latest
:: mkl -- latest
:: mpi -- latest
:: tbb -- latest
:: vpl -- latest
:: vtune -- latest
:: oneAPI environment initialized ::
This causes a problem with programs such as rsync which do not expect the server to return such a long string after login, giving the following error... "protocol version mismatch -- is your shell clean?"
Thanks!
-Joe
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you redirect the console output of the source command to NUL?
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
is the 'source' command in a script?
Or did you put the 'source' in your .bashrc or another dot file? If you put it in .bashrc, for example, all subshells will do the 'source'. Perhaps you only want the 'source' in true interactive shells? I'm not sure if rsync invokes an interactive or non-interactive shell on the remote host - do you know? https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html
https://superuser.com/questions/965987/why-does-rsync-read-bashrc-and-not-profile
The above suggests rsync is non-interactive but that thread is from 2015. Probably still true though. So again, for rsync you may want to put the 'source' in .profile instead of .bashrc so it's only for interactive shell invocation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah, this script needs an argument to suppress the prints. They are also messing me up. Appending `2>&1 /dev/null` doesn't seem to do anything?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what OS and version are you using?
This worked from command line on Fedora 35
Are you putting the 'source' into a dot file? if so, which one?
source /nfs/pdx/disks/cts2/tools/oneapi/2023.0.0/setvars.sh > /dev/null 2>&1
works from command line for me. I can possibly see an issue with this in a dot file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
linux for those who have trouble carrying the full UNIX mass or weight if you are into Imperial.
--------------------------------------------------------------
The Unix operating system consists of many libraries and utilities along with the master control program, the kernel. The kernel provides services to start and stop programs, handles the file system and other common "low-level" tasks that most programs share, and schedules access to avoid conflicts when programs try to access the same resource or device simultaneously. To mediate such access, the kernel has special rights, reflected in the distinction of kernel space from user space, the latter being a priority realm where most application programs operate.
---------------------------------------------------------------
The kernel is just a simple human consciousness replacement - what do I do next.
Interesting.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page