It doesn't work that way. First, you need to use a "command substitution" for the seq command. Then, $X will be expanded to 1 .. $#, NOT to the values of the respective positional parameters. There are other ways:
or
which will assign elements starting from 0, or, less favoured, using the deprecated (and dangerous) eval,
hi
i have a function
abc
{
//from this function i am passing args to antoher function like
def a b c j k l
}
now i want to count the no of args coming to def() function and iterate over those values
is there any way to do this one
please help (2 Replies)
Hi,
I am using SYBASE database. in my script i am connecting to DB via using isql.
isql -U${S_USER} -S${S_SERV} -D${S_DB} -P${S_PWD} -b0 -w3000 -h0 -s"|" -i${MYDIR}/ABC.sql -oXYZ.txt << FINSQL
i am taking a ABC.sql file to use the queries written in it and storing the output in... (3 Replies)
hi,
i have an rpm, and i am looking at the presinstall script. i can see it takes in an argument, but what i do not know is how this argument is passed to the script? is there something that calls the preinstall script? i thought the preinstall script was the first thing executed.
thanks (2 Replies)
Hi Guys,
I am trying to pass arguments to the script i am wrinting.
When no argument is passed or wrong argument is passed, the script needs to output the way it needs to be called and exit.
Currently, when no arguments is passed, it is not getting exited but goes on assuming those... (3 Replies)
Hi
I want to write a script which store all the parameters passed to the script into an array.
Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD.
I want to know how can I... (3 Replies)
this is my issue.
4 parameters are passed from korn shell to sql script.
parameter_1= varchar2 datatype or no value entered my user.
parameter_2= number datatype or no value entered my user.
parameter_3= number datatype or no value entered my user.
parameter_4= number datatype or no... (5 Replies)
Hi all,
I am trying to delete columns in a file using a script. The columns that need to be deleted are passed as arguments to the script.
The script should look like this
> delete_columns.sh <file_name.txt> <column_numbers_to_be_deleted>
The contents of the file_name.txt will be like ... (5 Replies)
My requirement is that I want to pass similar argument to a shell script and process it in the script. Something like below:
myScript.sh -c COMPONENT1 -c COMPONENT2 -a APPNote: -c option can be specified multiple times and -a is optional parameter
I know this can be achieved using... (2 Replies)
Hi All,
I have a script which intends to create as many variables at runtime, as the number of parameters passed to it. The script needs to save these parameter values in the variables created and print them
abc.sh
----------
export Numbr_Parms=$#
export a=1
while
do
export... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies
LEARN ABOUT DEBIAN
dtc_setup_vps_disk
dtc_setup_vps_disks(8) System Manager's Manual dtc_setup_vps_disks(8)NAME
dtc_setup_disk - setup LVM disks for using it as a VM
SYNOPSIS
dtc_setup_vps_disk.sh VPS_NUMBER HDD_SIZE SWAP_SIZE [ lvm|loopback ]
DESCRIPTION
dtc_setup_vps_disk.sh This shell script is a part of the dtc-xen package that is to be used by the dtc panel to manage a Xen VPS server.
This script is used to create partitions to be used by a VPS later on. It will create a normal partition that will be used as a root disk,
and a swap partition.
dtc_setup_disk is to be used by the dtc-xen SOAP server, but can also be used as a standalone userland tool.
If the partition(s) exists, then this script will delete it/them first.
OPTIONS
VPS_NUMBER has to be a number between 01 and 19. Let's say the number is 16, and that dtc-xen is configured to use the volume group called
lvm1, then this script will create /dev/lvm1/xen16 and /dev/lvm1/xen16swap.
HDD_SIZE Size in MB of the VPS partition to create.
SWAP_SIZE Size in MB of the VPS swap partition to create. If the dtc-xen SOAP server is used to create the VPS, then it will create a swap
partition of the exact same size as the memory.
IMAGE_TYPE This parameter can have 2 values: either lvm or loopback. If ommited, then lvm is used. If lvm is used, then this script will
create a partition using lvmcreate, otherwise it will create an image file. Both will later be used for the VPS.
EXAMPLE
dtc_setup_vps_disk 04 15360 256 lvm
This will create 2 LVM partition to be used by the VPS named xen04, the first one being a root partition of 15 GB, and the second one being
a swap partition of 256 MB.
VERSION
This documentation describes dtc_setup_vps_disk version 0.3.15. See http://www.gplhost.com/software-dtc-xen.html for updates.
SEE ALSO dtc_reinstall_os(8), dtc_kill_vps_disk(8)dtc_setup_vps_disks(8)