This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Konsole in Dolphin is different to Konsole as application

Tags: None
(comma "," separated)
User avatar
ooker
Registered Member
Posts
121
Karma
1
I add this line to my ~/.bashrc:
Code: Select all
source /usr/local/gromacs/bin/GMXRC

so that I can launch my program in any shell. However it doesn't work when I use the Konsole intergrated in Dolphin. What should I do?
User avatar
google01103
Manager
Posts
6668
Karma
25
what kind of file is GMXRC is? 'cause the source command iirc executes the contents of a file. I would think you'd want to add /usr/local/gromacs/bin to your $PATH so you could execute it when desired


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
ooker
Registered Member
Posts
121
Karma
1
This is the contain of GMXRC
Code: Select all
# This is a convenience script to determine which
# type of shell you have, and then run GMXRC.[csh|bash|zsh]
# from the Gromacs binary directory.
#
# If you only use one shell you can copy that GMXRC.* instead.


# only csh/tcsh set the variable $shell (note: lower case!)
test $shell && goto CSH

# if we got here, shell is bsh/bash/zsh/ksh
# bsh cannot remove part of a variable with %%
shtst="A.B"
if [ "`(echo ${shtst%%.*}) 2>/dev/null`" = A ]; then

  # shell is bash/zsh/ksh
  # bash/zsh use $[...] for arithmetic evaluation, ksh doesn't
  if [ "`echo $[0+1]`" = 1 ]; then
   
    # shell is zsh/bash
    # zsh can test if the variable shtst is set with ${+shtst}
    if [ "`(echo ${+shtst}) 2>/dev/null`" = 1 ]; then
      # shell is zsh
      source /usr/local/gromacs/bin/GMXRC.zsh
    else 
      # shell is bash
      source /usr/local/gromacs/bin/GMXRC.bash     
    fi

  else   
    # shell is ksh - use bash setup, completions won't be read.
     . /usr/local/gromacs/bin/GMXRC.bash
  fi
  return
else
  # shell is bsh - use bash setup, completions won't be read.
  . /usr/local/gromacs/bin/GMXRC.bash
  exit
fi

# csh/tcsh jump here

CSH:
source /usr/local/gromacs/bin/GMXRC.csh


I have added it to my .bashrc and it works. I wonder what is the different between them?
PS: I kinda feel that the forum should have a hide button, so that the long script won't occupy much space.
User avatar
google01103
Manager
Posts
6668
Karma
25
ooker wrote:PS: I kinda feel that the forum should have a hide button, so that the long script won't occupy much space.


the code tags limits the amount of text displayed, at some point text will longer be displayed and a scroll bar will appear


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
ooker
Registered Member
Posts
121
Karma
1
It does appear the scroll bar, but it still seems to occupy so much space.

By the way, do you know what is the different between adding the path to $PATH and executing it?
User avatar
google01103
Manager
Posts
6668
Karma
25
Guessing the amount of lines displayed using code tags was either the sw's default or it was considered a good compromise between to much and too little by the original admins. An alternative is to post the text on something like pastebin.com but then the reader must go there

not sure about your 2nd question, $PATH is a variable so you don't execute it per se


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
ooker
Registered Member
Posts
121
Karma
1
It doesn't work again. Do you have any idea?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Can you please confirm that the shell being launched by the Dolphin embedded terminal is bash?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
ooker
Registered Member
Posts
121
Karma
1
Yeah, I can confirm that. Any command I type in like sudo apt-get install always works.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Please post the output of the following command:
Code: Select all
ps aux | grep $$


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
ooker
Registered Member
Posts
121
Karma
1
In Konsole:
Code: Select all
ooker@ooker-Aspire-4741:~$     ps aux | grep $$
ooker    13864  4.0  0.1   8508  3156 pts/8    Ss   14:28   0:00 /bin/bash
ooker    13986  0.0  0.0   6176   864 pts/8    S+   14:28   0:00 grep --color=auto 13864


In Yakuake:
Code: Select all
ooker@ooker-Aspire-4741:~$    ps aux | grep $$
root       922  0.0  0.1   6700  2328 ?        Ss   14:22   0:00 /sbin/wpa_supplicant -B -P /run/sendsigs.omit.d/wpasupplicant.pid -u -s -O /var/run/wpa_supplicant
ooker     2328  0.0  0.1   8616  3280 pts/6    Ss   14:23   0:00 /bin/bash
ooker    13031  0.0  0.0   6180   864 pts/6    S+   14:27   0:00 grep --color=auto 2328


In terminal of Dolphin:
Code: Select all
ooker@ooker-Aspire-4741:/data$ ps aux | grep $$
ooker    10676  0.0  0.1   8616  3284 pts/0    Ss   14:26   0:00 /bin/bash
ooker    19948  0.0  0.0   6176   864 pts/0    S+   14:30   0:00 grep --color=auto 10676
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Please add a statement such as the following below into ~/.bashrc and see if it gets printed out when you open a terminal.
Code: Select all
echo "test"


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
ooker
Registered Member
Posts
121
Karma
1
Yes, it do appear "test" when I open every shell, including the one in Dolphin.

After I type in the ps aux command, it works again. I don't know what happened. But now, when I type "which mdrun", the output is:
Code: Select all
/usr/local/gromacs/bin//mdrun

with double slashes. I know that this is OK for the OS, but maybe your command makes the path like this.
User avatar
ooker
Registered Member
Posts
121
Karma
1
It stop working again, however the "test" word still appears on the Dolphin's one, indicates that ~/.bashrc is still good. It only works back if I use
Code: Select all
ps aux
again.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
That is extremely odd behaviour. Please compare the output of "which mdrun" and "echo $PATH" both before and after running "ps aux".
Also, when it fails, what is the output given?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell