Quantcast
Channel: FedoraForum.org
Viewing all articles
Browse latest Browse all 36140

[SOLVED] [BASH]: variable empty at random?

$
0
0
Hello Community,

I'm quite confused about my current scripting issue...
I source a file wich contains some variables, like "ks_name=Awesome".
Then i echo some of the content, to verify its not empty, works...

But when i add multiple varibales together, the resulting variable is empty, eventhough i had added hardcoded text?!?

Here's the output:
Code:

# | Fedora : Script Tools 0.7.2 : root (0)                                          sa kick Awesome m : 2012.12.04-17.48.43 | #
# |                                              sea's Kickstart Handler (0.3)                                              | #
# | Selected project:                                                                                              Awesome | #
# |                                    Kickstart generator (0.3) for project: Awesome                                    | #
Awesome /home/simon/.config/script-tools/kickstarts
# | Saving kickstart:                                                                                              Awesome | #
# | File:                                                                                                                  | #
/usr/share/script-tools/Included_Functions/module.dev.prj.ks: line 124: $output: ambiguous redirect
# | Parsing: 00_header...

See the line without the starting "# |" where there is Awesome, and the path?
And the line starting with File: but righthand side is empty?

The 'original' variables are NOT empty, but placing them together results in an empty string?

Thats the echo of the script below and the issue i face.
Code:

#
        #        Title
        #
                [ "" = "$1" ] && lbl=$(KS_Prj_Select) || lbl="$1"
                sT "Kickstart generator ($script_version) for project: $lbl"
        #
        #        Variables
        #
                workdir=$SEA_DEV_DIR/$lbl/ks
                source $(dirname $workdir)/kickstart

                echo $ks_name $SEA_KS_DIR
                today="$(date +'%Y%m%d-%H%M')"
               
                output="bully hit:: $SEA_KS_DIR/$lbl-$today.ks"
                sE "Saving kickstart:" "$lbl"
                sE "File:"        "$output"

The variable output is empty, therefor the output to it results in an error with ambiguous redirect.
Even the plain text seems to be removed from the variable $output :(

Every hint or idea very welcome
Thank you in advance.
Simon

Viewing all articles
Browse latest Browse all 36140

Trending Articles