My requirement is need to add spaces to the string with the dynamic value to printf... this is a part of shell script ..which i have , the length is not static ...
The result it is printing is ... i am not sure y it is printing %-15s..
hi i am using printf in a script and it is not printing negative values..i have to use printf to get rid of the newline..here is my code:
fin=`echo $a - $b | bc`
printf "${fin}," >> test
these statements are in a loop. here is what i get when i try to subtract 4 from 8:
./scr1: line... (2 Replies)
i have written small script as follows:
name="hi hello"
printf "%-20s" $name
This gives me strange output. -20s format is applied on both word of string. i.e it displays both word hi and hello in space of 20 length.
I want to display entire string "hi hello" in length of 20 space.
plz... (2 Replies)
Hi ALL,
I am using SunOS 5.9 and KSH(bin/ksh)
The problem am facing is
error message diaplyed on screen
printf: 12099415.79 not completely converted
printf: + expected numeric value
printf: 11898578.29 not completely converted
When i try printing with
The output is... (6 Replies)
Hi all I am using printf in my shell script to format my output.I am using the following code.
printf "|\tIP Address\t|\tModel Number\t|\tDOM/HW\t|\tSoftware Version\t|\n"
printf "|\t%s\t|\t%s\t\t|\t%s\t|\t%s-%s\t\n" $encoder $modelno $type $sv1 $sv2
printf "|\tFPGA... (2 Replies)
Hi guys,
could someone throw some light on the following behaviour of printf (I'll start with info about the system and the tool/shell/interpreter versions)?:
$ uname -a
Linux linux-86if.site 3.1.0-1.2-desktop #1 SMP PREEMPT Thu Nov 3 14:45:45 UTC 2011 (187dde0) x86_64 x86_64 x86_64... (9 Replies)
A big hello to everyone tagged to this site of knowledge . This is the first post of mine and I am looking forward to an enjoyable stint in this forum where I get to know a lot of new ideas and share whatever knowledge (its not much though :) ) I have acquired throughout my career so far with... (4 Replies)
So I created two shell variables: COLUMN1_HEADING, COLUMN2_HEADING.
They have values:
COLUMN1_HEADING="John"
COLUMN2_HEADING="123456789"
How would I use printf to get it to print an output like this: $COLUMN1_HEADING\t$COLUMN2_HEADING\nJohn\t123456789\n
Thanks! (3 Replies)
I am running plsql using printf on a shell, but i am getting some strange error, can someone point what exactly am i missing,
$ echo $SHELL
/bin/bash
$ printf "
> SET serveroutput ON trimspool on feed off echo off
> declare
> p_val number;
> d_val varchar2(10);
> begin
> SELECT... (1 Reply)
Discussion started by: kamauv234
1 Replies
LEARN ABOUT OSX
git-sh-i18n
GIT-SH-I18N(1) Git Manual GIT-SH-I18N(1)NAME
git-sh-i18n - Git's i18n setup code for shell scripts
SYNOPSIS
. "$(git --exec-path)/git-sh-i18n"
DESCRIPTION
This is not a command the end user would want to run. Ever. This documentation is meant for people who are studying the Porcelain-ish
scripts and/or are writing new ones.
The 'git sh-i18n scriptlet is designed to be sourced (using .) by Git's porcelain programs implemented in shell script. It provides
wrappers for the GNU gettext and eval_gettext functions accessible through the gettext.sh script, and provides pass-through fallbacks on
systems without GNU gettext.
FUNCTIONS
gettext
Currently a dummy fall-through function implemented as a wrapper around printf(1). Will be replaced by a real gettext implementation in
a later version.
eval_gettext
Currently a dummy fall-through function implemented as a wrapper around printf(1) with variables expanded by the git-sh-
i18n--envsubst(1) helper. Will be replaced by a real gettext implementation in a later version.
GIT
Part of the git(1) suite
Git 2.17.1 10/05/2018 GIT-SH-I18N(1)