No window when launching bash

A home for all kinds of Puppy related projects
Post Reply
Message
Author
cubeslave
Posts: 4
Joined: Tue 13 Dec 2016, 17:48

No window when launching bash

#1 Post by cubeslave »

*FYI*
I am extremely new to linux programming and interface. I'm using the latest tahrpup from a bootable flash. I need it to be a bootable for the sheer fact that it needs to be ran on whatever pc I can get my hands on. It's main purpose is to be used on a production floor where certain files need to be written to multiple sd cards to allow us to continue production.

I created a simple bash to copy from one master drive to others. Problem is when I click it the program runs because I have activity lights on the sd card readers but no terminal window appears to show that it is actually running. Also it seems to take an extremely long time to finish the operation. I am copying a 2gb file from a 32gb sd card to two other 32gb sd cards.

Heres the code:

Code: Select all

#!/bin/bash
dd if=/dev/sdc1 of=/dev/sdd1 bs=64k &
dd if=/dev/sdc1 of=/dev/sde1 bs=64k &
I tried to get "pv" but no luck. I'm guessing since I have no access to internet with this particular computer. Any help or ideas as to why it's been taking so long or how in the hell to get it to display a terminal box so I can at least tell it has been launched would be AWESOME!

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hello cubeslave,

Where are you running your script from? A menu? In that case, nothing will
show, and that's ok because menus are designed to launch stuff in the
background.

Are you not already in a terminal when you launch your script? In this case
you should at least see the block cursor go down one line during execution,
and come back to the prompt when finished. Of course, dd is not a
particularly "verbose" utility, but still.

IHTH
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

cubeslave
Posts: 4
Joined: Tue 13 Dec 2016, 17:48

#3 Post by cubeslave »

I launching it from the desktop. I have seen another bash just exactly like this before on a much older version of puppy linux that opened a window when it was executed. stupid question: is puppy linux the same as tahrpup?

Edit:
Also, where abouts should I put it of I want it to launch like i want it to? Actual file path for this file is root/my-documents/Testing.sh

User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#4 Post by LazY Puppy »

I think there is a right-click action for shell scripts etc. in tahr.

Probably: Execute in Terminal ?

If not, don570 offers this in a right-click package somewhere on the forum (Utilities?).
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#5 Post by musher0 »

Hello cubeslave.

Short answer is yes.

TahrPup is a PuppyLinux based on ubuntu packages.
Slacko is the Puppy based on slackware packages.
And my own, Puduan-6, is a Puppy based on Devuan/Debian packages.

~~~~~~~
What do you mean "Launch from desktop"? Do you have an icon for this
script on your desktop and and you click on it?

Please explain a little more, perhaps describe your steps when launching
this.

As I mentioned earlier, first, dd is not verbose, and 2nd, if you launch it
from an icon, again it will work in the background and not show anything.

If you want it to show in a terminal, you may need a little launcher for it,
something like

Code: Select all

#!/bin/sh
# /usr/local/bin/dd-launch.sh # name of this launcher
# launcher for my-dd-script.sh
####
urxvt -e my-dd-script.sh
in the same directory as "my-dd-script.sh". But then your icon should
be for the dd-launch.sh script and not for my-dd-script.sh.

Then a terminal will appear on screen with "my-dd-script.sh" executing
in it.

~~~~~~~
Finally, a suggestion: always put the file name of your script inside the
script on the 2nd line, as I did, with full path. This will save you many
headaches later, trying to remember what this script does.

~~~~~~~
Obvious question: is it working? ;)

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

LazY Puppy wrote:I think there is a right-click action for shell scripts etc. in tahr.

Probably: Execute in Terminal ?

If not, don570 offers this in a right-click package somewhere on the forum (Utilities?).
Yeah, this may work too. I had forgotten about this one.

Thanks Busy_Puppy!
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#7 Post by LazY Puppy »

musher0 wrote:Thanks Busy_Puppy!
:lol:

Yes, I'm busy these days. But there's less Puppy-doing. Started working in a Cafe for a welfare organization called: Diakonisches Werk, I'm serving Coffe, making sandwiches, cooking sausages with potato salad etc.pp. for poor people like me one is.

So my planner is full, since I'm in the need to do a lot of rehearsal on the drums etc.pp.

Plus just the usual stuff as almost everywhere like to see my girlfriend, to eat, drink and to sleep...
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#8 Post by don570 »

If you're looking for the script that opens a script using a right click
look here. It's inside the pet package. Just follow the links.
http://www.murga-linux.com/puppy/viewtopic.php?p=813439

Right-click-6.8.2.pet

____________________________________

cubeslave
Posts: 4
Joined: Tue 13 Dec 2016, 17:48

#9 Post by cubeslave »

I will take heed, but not at work now so testing must cease. I will let you guys know asap tomorrow morning. Thanks for the help so far though!

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#10 Post by Flash »

The reason it's taking so long may be that you have used the dd command that copies everything that's on the 32 GB flash drive rather than only the 2 GB file you want.

I once tried to clone a Puppy DVD-RW. Turned out that the DVD-RW had previously been filled up and then "erased" before I burned Puppy on it - but only the TOC was erased. So when dd was told to copy everything on the DVD-RW, it copied everything all the way to the end, even the stuff that wasn't in the TOC. It took a long time and completely filled the DVD-R that was being written to.

cubeslave
Posts: 4
Joined: Tue 13 Dec 2016, 17:48

#11 Post by cubeslave »

So I'm sorta giving up at this point.
I'm just going to have to right click > Run in Terminal
and as far as it taking forever I think I solved it by just partitioning to about 8GB to reduce the amount of transfer so it doesnt copy the ENTIRE sd.

Thanks for all the help.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#12 Post by Flash »

You don't have to right-click in a Rox directory and then choose Run in terminal. If you're in a Rox directory, pressing the ` key (usually also the ~ key) will open a rxvt instance in that directory.

Wognath
Posts: 423
Joined: Sun 19 Apr 2009, 17:23

#13 Post by Wognath »

"Clickable script" opens its own terminal:
http://www.murga-linux.com/puppy/viewtopic.php?t=59322
rcrsn51 wrote:Just place the following three lines at the top of the script (without any blank lines):
Code:
#!/bin/sh
tail -n +4 $0 > /tmp/script.txt
exec rxvt -e sh /tmp/script.txt

Post Reply