Bug 174554

Summary: In a bash script, the command : " konsole "$0" args " fails in one case
Product: [Applications] konsole Reporter: Jonas <Jonas.Baggett>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED NOT A BUG    
Severity: normal    
Priority: NOR    
Version: 2.1   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Jonas 2008-11-07 18:28:34 UTC
Version:           2.1 (using 4.1.3 (KDE 4.1.3), Debian packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.27-4.slh.5-sidux-686

I found a bug with the new konsole of kde 4.1.x with doesn't exists with the konsole of kde 3.5.x.

I have made a bash script called "test.sh" (located in ~/test) :

#!/bin/bash

if [ $1 ]; then
  echo "ok"
  sleep 5
else
  konsole -e "$0" a
fi

The idea is when clicked it launchs itself in a new konsole, and it works.


I have made another bash script "launch_all.sh" :

#!/bin/sh

cd ~/test # Go to the directory in which there is the "test.sh" script

for i in `ls *.sh` ; do
  ./$i
done

Then it should launchs the script "test.sh", but it launchs a new konsole in which is displayed this error message :

Warning: Could not start program './test.sh' with arguments './test.sh a'.
Comment 1 Narcis Garcia 2009-01-13 16:56:34 UTC
This is because konsole starts by default on $HOME directory, and you are trying to run that script as if you maintain the working directory.

Konsole (as other terminals do) may not change the working directory, but you can skip this problem making the call in this way:

konsole --workdir "$PWD"-e "$0" a
Comment 2 Kurt Hindenburg 2009-05-08 16:51:11 UTC
Coment #1 works fine in KDE 4.2.x