Sponsored Content
Full Discussion: Project - ERP-MES Interface
The Lounge War Stories Project - ERP-MES Interface Post 302774655 by Don Cragun on Saturday 2nd of March 2013 08:19:25 PM
Old 03-02-2013
I have no idea what you're trying to do and the variable names don't make any sense to me, but the following is a reformatted, simplified version of your script that is a valid bash script (and is easier for humans to read) that produces some output that may be what you want:
Code:
#!/bin/bash
fkt_auffuellen() {
        case $1 in
        (C)     if [ ${#2} -eq "$3" ]
                then    value="$2"
                else    value="$(printf "%-$3.$3s" "$2")"
                fi;;
        (N)     ;;
        (D)     ;;
        esac
}
vorg_nr_t=C
vorg_nr="AUFTRAG005-010010"
vorg_nr_l=40
fkt_auffuellen $vorg_nr_t $vorg_nr $vorg_nr_l
vorg_nr="$value"
echo "$vorg_nr"

Note that some double-quotes were added and others were removed, an if statement was removed by changing the printf format string, and I added opening parentheses to the case matching patterns. (The opening parentheses are allowed but are not required by bash, but if you're editing a larger script with an editor such as vi with a showmatch option, having them makes it much easier to find mismatched parentheses in places where they do matter.)

Hope this helps.
This User Gave Thanks to Don Cragun For This Post:
 

7 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Linux based Open Source ERP System - CK-ERP

Hi, folks, I have developed CK-ERP, which is an open source accounting / MRP / ERP / CRM system that runs on top of multiple middlewares. It provides accounting and back office functionalities to SMEs and utilizes the underlying middleware to administer accounts/groups. Details about and... (0 Replies)
Discussion started by: chiukay
0 Replies

2. Programming

Compilation problem with Posix Mes Q

Hi #include "training.h" #include <mqueue.h> // for posix mqs int main(int argc,char *argv) { int opt,flag; mqd_t msq; // msg q type flag=O_RDWR|O_CREAT; while((opt =getopt(argc,argv,"e")) != -1) { switch(opt) { case 'e': ... (4 Replies)
Discussion started by: kumaran_5555
4 Replies

3. Solaris

Command line Interface or GUI Interface not shown on solaris

Dear all, I am a newbie in solaris and I need your advice. I have a Solaris version 5.9 installed on Sunfire V240. I am able to ssh the machine from putty remotely. My problem is that I cannot see the display from KVM switch I have connected to it. I need also to be able to see the GUI... (2 Replies)
Discussion started by: mbouster
2 Replies

4. SCO

Change SCO - GUI or Desktop interface to DOS based interface

Hi all I have installed a demo version of SCO OpenServer 5.0.2, I finally found it is Desktop Interface, I would like to know how to change its interface to dos based interface? If you have any ideas, please tell me then. Thank you (2 Replies)
Discussion started by: TinhNhi
2 Replies

5. UNIX and Linux Applications

CK-ERP (Open Source Edu / ERP / CRM / MRP) v.0.30.1 released

Hi, folks, A new release, v.0.30.1, of CK-ERP, has been posted, at SourceForge.Net, sourceforge.net/projects/ck-erp . New features comprise seven new modules (ck-teacher, ck-counsellor, ck-student, ck-applicant, ck-family, ck-registrar, ck-eduadmin) for deployment within educational... (0 Replies)
Discussion started by: chiukay
0 Replies

6. Shell Programming and Scripting

ERP - MES Interface - several function

Hi all, I am a rookie regarding shell script programming, YET!! :-) Hence, I have choosen a problem from my bad side of life (my job) and I wil try to solve it by using a shell script and get knowledge concerning shell script programming. Question: As you can see I have already figured... (5 Replies)
Discussion started by: Noobie1995
5 Replies

7. News, Links, Events and Announcements

A new project was posted on The UNIX and Linux Forums project board.

A new project was posted on your project board. Project title: Bash Shell Tutoring Estimated Budget: $50/hr Start date: Immediately Required skills: Linux, Bash, Shell, UNIX I work as a datawarehouse designer and developer. Although I usually stick to the role of an analyst,... (0 Replies)
Discussion started by: Neo
0 Replies
BASHBUG(1)						      General Commands Manual							BASHBUG(1)

NAME
bashbug - report a bug in bash SYNOPSIS
bashbug [--version] [--help] [email-address] DESCRIPTION
bashbug is a shell script to help the user compose and mail bug reports concerning bash in a standard format. bashbug invokes the editor specified by the environment variable EDITOR on a temporary copy of the bug report format outline. The user must fill in the appropriate fields and exit the editor. bashbug then mails the completed report to bug-bash@gnu.org, or email-address. If the report cannot be mailed, it is saved in the file dead.bashbug in the invoking user's home directory. The bug report format outline consists of several sections. The first section provides information about the machine, operating system, the bash version, and the compilation environment. The second section should be filled in with a description of the bug. The third sec- tion should be a description of how to reproduce the bug. The optional fourth section is for a proposed fix. Fixes are encouraged. ENVIRONMENT
bashbug will utilize the following environment variables if they exist: EDITOR Specifies the preferred editor. If EDITOR is not set, bashbug defaults to emacs. HOME Directory in which the failed bug report is saved if the mail fails. TMPDIR Directory in which to create temporary files and directories. SEE ALSO
bash(1) AUTHORS
Brian Fox, Free Software Foundation bfox@gnu.org Chet Ramey, Case Western Reserve University chet@po.cwru.edu GNU Bash-4.0 1998 July 30 BASHBUG(1)
All times are GMT -4. The time now is 09:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy