Skip to main content
edited body
Source Link
Asaf Magen
  • 113
  • 1
  • 1
  • 6

Im trying to source a large script with many functions in it that take some time. I would like to present a dialog "sourcing please wait..." in the mean time. once done sourcing i want to use my functions. but using the dialog seems to cancel the souring. the sourcing does processed with the dialog but the function does not run.

file: main.script.sh

!#!/bin/bash

long task...

function PritnDatePrintDate(){
date
}

file: job1.sh

!#!/bin/bash
source main.script.sh | dialog --progressbox "sourcing please wait..." 20 80
PrintDate

command prompt:

bash job1.sh

output i get

PrintDate: command not found

Im trying to source a large script with many functions in it that take some time. I would like to present a dialog "sourcing please wait..." in the mean time. once done sourcing i want to use my functions. but using the dialog seems to cancel the souring. the sourcing does processed with the dialog but the function does not run.

file: main.script.sh

!#/bin/bash

long task...

function PritnDate(){
date
}

file: job1.sh

!#/bin/bash
source main.script.sh | dialog --progressbox "sourcing please wait..." 20 80
PrintDate

command prompt:

bash job1.sh

output i get

PrintDate: command not found

Im trying to source a large script with many functions in it that take some time. I would like to present a dialog "sourcing please wait..." in the mean time. once done sourcing i want to use my functions. but using the dialog seems to cancel the souring. the sourcing does processed with the dialog but the function does not run.

file: main.script.sh

#!/bin/bash

long task...

function PrintDate(){
date
}

file: job1.sh

#!/bin/bash
source main.script.sh | dialog --progressbox "sourcing please wait..." 20 80
PrintDate

command prompt:

bash job1.sh

output i get

PrintDate: command not found
deleted 3 characters in body
Source Link
Asaf Magen
  • 113
  • 1
  • 1
  • 6

Im trying to source a large script with many functions in it that take some time. I would like to present a dialog "sourcing please wait..." in the mean time. once done sourcing i want to use my functions. but using the dialog seems to cancel the souring. the sourcing does processed with the dialog but the function does not run.

file: main.script.sh

!#/bin/bash

long task...

function PritnDate(){
date
}

file: job1.sh

!#/bin/bash
source main.script.sh | dialog --progressbox "sourcing please wait..." 20 80
PrintDate

command prompt:

bash job1.sh

output i get

PrintDate: is command not found

Im trying to source a large script with many functions in it that take some time. I would like to present a dialog "sourcing please wait..." in the mean time. once done sourcing i want to use my functions. but using the dialog seems to cancel the souring. the sourcing does processed with the dialog but the function does not run.

file: main.script.sh

!#/bin/bash

long task...

function PritnDate(){
date
}

file: job1.sh

!#/bin/bash
source main.script.sh | dialog --progressbox "sourcing please wait..." 20 80
PrintDate

command prompt:

bash job1.sh

output i get

PrintDate: is command not found

Im trying to source a large script with many functions in it that take some time. I would like to present a dialog "sourcing please wait..." in the mean time. once done sourcing i want to use my functions. but using the dialog seems to cancel the souring. the sourcing does processed with the dialog but the function does not run.

file: main.script.sh

!#/bin/bash

long task...

function PritnDate(){
date
}

file: job1.sh

!#/bin/bash
source main.script.sh | dialog --progressbox "sourcing please wait..." 20 80
PrintDate

command prompt:

bash job1.sh

output i get

PrintDate: command not found
Source Link
Asaf Magen
  • 113
  • 1
  • 1
  • 6

using source command with dialog

Im trying to source a large script with many functions in it that take some time. I would like to present a dialog "sourcing please wait..." in the mean time. once done sourcing i want to use my functions. but using the dialog seems to cancel the souring. the sourcing does processed with the dialog but the function does not run.

file: main.script.sh

!#/bin/bash

long task...

function PritnDate(){
date
}

file: job1.sh

!#/bin/bash
source main.script.sh | dialog --progressbox "sourcing please wait..." 20 80
PrintDate

command prompt:

bash job1.sh

output i get

PrintDate: is command not found