I am new to shell, and I am trying to do a if statement like the following:
if ; then
basically it works fine if both arguments of the if are met, however the next elif is:
elif ; then
if the conditions of the elif are met, then it says "final1.sh: line 67: [: too many arguments"
... (6 Replies)
The printf statement
pay_amount=$(printf "%013.3f" "$4")
working perfectly at one path(xxx/home/rsh) and showing error (printf: 216.000: invalid number) at another path(/opt/xxxx/xxxx).
what will be the reason?
thanks in advance (4 Replies)
Hello friends,
I have a boubt passing different arguments at a time for any one option in below code.
I would also like to check which option has been selected (any one of i, r, u ) so that whether or not matching argument passed can be verified.
for i and r - install and re-install -... (4 Replies)
What would be correct syntax in a script to check to see if a /export/nfs/home mount point is mounted and if not stop/abort? OS is Solaris 10 using standard VI ksh shell. Here is the script. Please tell me where you see the problem.
#!/bin/bash
#
# This script is run as root to sync AMI PROD... (0 Replies)
Hi all
I'm new to this forum and I really hope someone can help me out with a (for you guys) fairly easy question.
I want to have a script that takes 1-14 arguments, all numbers 1-14, say
myscript 1 3 4 5 7
what the script shall do is basically generare a textfile that contains 16... (5 Replies)
Hi
Am pretty new to C..
Am trying to pass the arguments from command line and use them in switch case statement..
i have tried the following
#include <stdlib.h>
main(int argc, char* argv)
{
int num=0;
if ( argc == 2 )
num = argv;
printf("%d is the num value",num);
switch ( num )
... (2 Replies)
hi all i need to add the prinf statement in awk command for the converted comma separated output....
below is my code :
Code Credits :RudiC
awk -F, 'NF==2 {next}
{ITM=$1
AMT=$2+0
CNT=$3+0
TOTA+=$2
... (4 Replies)
hi all,
I had my script as
a=qw
b=rter
c=fdfd
curency=1000
printf"${curency} $a $b $c" > filename
can i have printf statement that can change the currency from 1000 to 1,000 like it should convert the number to currency format ..?(i.e for any number) (14 Replies)
Hello,
I have a question regarding the usage statement of a script.
I have 2 parameters "--pto" and "--pto_list". To start the script I will need one of them. Both together are not possible.
How this would be printed out within a usage statement?
My suggestion would be:
Usage:... (4 Replies)
I'm stuck on a particular problem and need some guidance. I have a file with a name and a phone number in it (teledir.txt). I need to do a $# in a separate script to take a positional parameter and check to see if it is in the file. To quote the question:
If one argument is supplied, check... (6 Replies)