[SOLVED]there are annoying paths in terminal

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
Filippo
Level 2
Level 2
Posts: 90
Joined: Fri Nov 06, 2020 3:38 am

[SOLVED]there are annoying paths in terminal

Post by Filippo »

hi, i have installed Xilinx ISE Webpack in my pc, a sowtware that i use for work
for complete the installation i had to add a path in file .bashrc, so i wrote in terminal

Code: Select all

nano .bashrc
and i had to insert in the last line:

source /opt/Xilinx/14.7/ISE_DS/settings64.sh

in this way when i write in terminal "ise" the software start

but i have always some paths in my terminal and they are annoying me :/.
these:
Schermata del 2021-01-12 17-06-53.png
how can i hide them?
thanks in advance
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
xenopeek
Level 25
Level 25
Posts: 29609
Joined: Wed Jul 06, 2011 3:58 am

Re: there are annoying paths in terminal

Post by xenopeek »

Try replacing the command with:
source /opt/Xilinx/14.7/ISE_DS/settings64.sh &>/dev/null

The "&>/dev/null" thingy redirects all output so that it isn't printed.
Image
Filippo
Level 2
Level 2
Posts: 90
Joined: Fri Nov 06, 2020 3:38 am

Re: there are annoying paths in terminal

Post by Filippo »

many thanks.
now they don't exist anymore.

but sometimes when i write wrong command the terminal gives me that:
Schermata del 2021-01-12 17-31-18.png
and this puts me in trouble when i have to understand where is the error.

can i avoid that the terminal print this when there are errors?
User avatar
xenopeek
Level 25
Level 25
Posts: 29609
Joined: Wed Jul 06, 2011 3:58 am

Re: there are annoying paths in terminal

Post by xenopeek »

I think you shouldn't source the Xilinix file in your .bashrc; that affects every terminal you use.

A short search found me this alternative solution: https://wiki.archlinux.org/index.php/Xi ... ktop_icons.

To do this follow these steps:
1. Open your file manager and toggle to display hidden files (through View menu or press Ctrl+H)
2. In your home directory spot the .local directory and open that, then open the share directory there and then go into the applications directory
3. Create a new file here and name it ise.desktop
4. Right-click the file and select Open With -> Text Editor from the context menu
5. Put this in the file and save & close it:

Code: Select all

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Name=Xilinx ISE
Exec=bash -c "unset LANG && unset QT_PLUGIN_PATH && source /opt/Xilinx/14.7/ISE_DS/settings64.sh && ise"
Icon=/opt/Xilinx/14.7/ISE_DS/ISE/data/images/pn-ise.png
Categories=Development;
Comment=Xilinx ISE
StartupWMClass=_pn

You should now have a "Xilinx ISE" in your menu, in the Programming category (may take some seconds to appear in the menu; if it's not there close the menu and try again in few seconds — you may have to log out and back in in some cases). You should be able to start it with that.

If it works you can remove the line to source the Xilinix file from your .bashrc file and that solves the problem you described.
Last edited by xenopeek on Tue Jan 12, 2021 2:46 pm, edited 1 time in total.
Reason: replaced sh with bash
Image
Filippo
Level 2
Level 2
Posts: 90
Joined: Fri Nov 06, 2020 3:38 am

Re: there are annoying paths in terminal

Post by Filippo »

i tried and the icon appears in menu, but if i click on it the program doesn't start
Rootbeer
Level 3
Level 3
Posts: 115
Joined: Sun Nov 24, 2019 3:22 am

Re: there are annoying paths in terminal

Post by Rootbeer »

xenopeek wrote: Tue Jan 12, 2021 12:21 pm Try replacing the command with:
source /opt/Xilinx/14.7/ISE_DS/settings64.sh &>/dev/null

The "&>/dev/null" thingy redirects all output so that it isn't printed.
is &>/dev/null a combination of both 1> and 2> ?
1>/dev/null 2>/devnull

or, what is the function of & ?

Or is the & simply for making it into a background process and is really &1> but automatically assumes 1 per default if missing desciptor ?
User avatar
xenopeek
Level 25
Level 25
Posts: 29609
Joined: Wed Jul 06, 2011 3:58 am

Re: there are annoying paths in terminal

Post by xenopeek »

Filippo wrote: Tue Jan 12, 2021 1:14 pm i tried and the icon appears in menu, but if i click on it the program doesn't start
Darn. I don't have it here to test but would suggest to take this path. Do you normally start the program with command ise on the terminal or some other command?

Suggest to remove the source /opt/Xilinx/14.7/ISE_DS/settings64.sh … line from .bashrc, then open a new terminal and run the command manually like this:
unset LANG && unset QT_PLUGIN_PATH && source /opt/Xilinx/14.7/ISE_DS/settings64.sh && ise
Does that give any errors or does it start the program as per usual then?

Rootbeer wrote: Tue Jan 12, 2021 1:28 pm is &>/dev/null a combination of both 1> and 2> ?
1>/dev/null 2>/devnull
Yes https://www.gnu.org/software/bash/manua ... dard-Error
Image
Filippo
Level 2
Level 2
Posts: 90
Joined: Fri Nov 06, 2020 3:38 am

Re: there are annoying paths in terminal

Post by Filippo »

Do you normally start the program with command ise on the terminal or some other command?
yes, for starting the program i write "ise".

and if i write in terminal this:

Code: Select all

 unset LANG && unset QT_PLUGIN_PATH && source /opt/Xilinx/14.7/ISE_DS/settings64.sh && ise
the software start normally without errors.
User avatar
xenopeek
Level 25
Level 25
Posts: 29609
Joined: Wed Jul 06, 2011 3:58 am

Re: there are annoying paths in terminal

Post by xenopeek »

Hm. Try replacing the line in the ise.desktop file:
Exec=sh -c "unset LANG && unset QT_PLUGIN_PATH && source /opt/Xilinx/14.7/ISE_DS/settings64.sh && ise"
with:
Exec=bash -c "unset LANG && unset QT_PLUGIN_PATH && source /opt/Xilinx/14.7/ISE_DS/settings64.sh && ise"
Image
Filippo
Level 2
Level 2
Posts: 90
Joined: Fri Nov 06, 2020 3:38 am

Re: there are annoying paths in terminal

Post by Filippo »

wu-huuu thank you so much now it's all right :lol:
Locked

Return to “Scripts & Bash”