You are not logged in.

#26 2006-10-31 11:19:22

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: bash scripting help..

Alright found the problem. When using source I shouldnt include#!/bin/bash..

Without it works just fine now.


The ultimate Archlinux release name: "I am your father"

Offline

#27 2006-10-31 12:42:37

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: bash scripting help..

How can i time the time it takes for the script to execute in the script...

I could run another script that executes the main script with time: time restore.sh

But I dont want another script just for that.. Is there a way to do this in the main script?


The ultimate Archlinux release name: "I am your father"

Offline

#28 2006-10-31 13:01:55

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: bash scripting help..

Alright.. I am thinking of echo'ing date into a log.txt at the beginning of the script and at the end of the script. There I can see the time difference.


The ultimate Archlinux release name: "I am your father"

Offline

#29 2006-10-31 14:12:24

Pajaro
Member
Registered: 2004-04-21
Posts: 884

Re: bash scripting help..

you could also add this to the beginning of your app:

if ! [ "$TIME_ENABLED" ]; then
    TIME_ENABLED="1" time $0 $@
    exit;
fi

Offline

#30 2006-11-03 11:22:32

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Re: bash scripting help..

Im done with the script right now.. Gonna test it out with vmware, and see it if works as i wish it will.
Its a very veeery simple script... actually my first script more than 10 lines..  Will probably build it out more eventually.

thx again.


The ultimate Archlinux release name: "I am your father"

Offline

Board footer

Powered by FluxBB