Sponsored Content
Top Forums Shell Programming and Scripting ERP - MES Interface - several function Post 302774573 by MadeInGermany on Saturday 2nd of March 2013 12:37:58 PM
Old 03-02-2013
And the same rule applies here:
Code:
value=$(printf "%-$3s" "$2")

value= is an assignment, no need for quotes.
$2 is an argument (of the printf command), to be quoted.

---------- Post updated at 12:37 PM ---------- Previous update was at 12:27 PM ----------

The exception proves the rule:
Code:
if [ ${#2} -eq "$3" ]; then

These are arguments to the [ ] (test) function.
The $3 should be quoted if can be tampered with, e.g. became a * or 1 2.
Not needed, if your script guarantees a number.
The ${#2} is always a number.
This User Gave Thanks to MadeInGermany For This Post:
 

8 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. UNIX for Dummies Questions & Answers

Command 'rm -f -r "0yfOYy-0008Nq-2j-32233-K"' failed with return code 1 and error mes

I would like to know what means this error and how to fix it Command 'rm -f -r "0yfOYy-0008Nq-2j-32233-K"' failed with return code 1 and error message Thank you (3 Replies)
Discussion started by: linuxbee
3 Replies

3. 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

4. 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

5. 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

6. 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

7. IP Networking

Need a bridge from an ethernet interface to a serial interface

This is my situation DOS pc serial cable (sl0) Linux Pc eth1 192.168.0.10 <-------------------->192.168.0.2 <------------>192.168.0.1 (router) I connected the linux pc and the dos pc with a SLIP (serial line internet protocol), so they can communicate in the sl0 interface. ... (3 Replies)
Discussion started by: mghis
3 Replies

8. War Stories

Project - ERP-MES Interface

Hi all, that's my personal "war story" and probably a beginning of a never ending love story. It is roughly 8 weeks ago, I've got a training for a new ERP system. In front of the training my boss mentioned it based on a unix. Great, I have been always interested in but I don't know why I... (2 Replies)
Discussion started by: Noobie1995
2 Replies
script(1)							   User Commands							 script(1)

NAME
script - make record of a terminal session SYNOPSIS
script [-a] [filename] DESCRIPTION
The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the record is saved in the file typescript. See WARNINGS. The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends when the forked shell exits or when Control-d is typed. OPTIONS
The following option is supported: -a Appends the session record to filename, rather than overwriting it. NOTES
script places everything that appears on the screen in filename, including prompts. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) WARNINGS
script can pose a security risk when used in directories that are writable by other users (for example, /tmp), especially when run by a privileged user, that is, root. Be sure that typescript is not a link before running script. SunOS 5.11 30 Jan 2004 script(1)
All times are GMT -4. The time now is 12:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy