01-16-2014
If running bash, check its man page for the mapfile / readarray command.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello Everybody,
Does anyone know what the @ symbol means in a csh script, if used with a variable assignment as below
@ line = 1
why not just use....
set line=1
Many thanks
rkap (1 Reply)
Discussion started by: rkap
1 Replies
2. Shell Programming and Scripting
Hi,
I'm writing a KSH script, and at one point, I have to call a new shell and perform some variable assignments.
I noticed that the assignment is not working.
Please see two samples below:
Command 1:
#>ksh "i=2;echo I is $i"
Output:
#>I is
Command 2:
#>ksh <<EOF
> i=2
> echo I... (7 Replies)
Discussion started by: maverick80
7 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I am having a problem with assigning a value to a variable. The empname is looked for in the employees file and I am trying to assign it to the jobnum variable in the following statement
jobnum= cat/etc/employees | grep $empname | cut -d : -f 5
It is getting the right answer but it is... (3 Replies)
Discussion started by: rodney08
3 Replies
4. Shell Programming and Scripting
Guys,
Could you please help me out. I need two values in two variables using awk from the o/p of grep.
example:-
grep sdosanjh <filename>
sdosanjh myhostname myfilename
NOW WHAT I WANT IS :-
sdosanjh should be in variable (say NAME)
myhostname should be in variable (say... (8 Replies)
Discussion started by: sdosanjh
8 Replies
5. Shell Programming and Scripting
Hi,
i have an issue with eval and variable assignment.
1) i have a date value in a variable and that date is part of a filename,
var1=20100331
file1=${var1}-D1-0092.xml.zip
file2=${var2}-D2-0092.xml.zip
file3=${var3}-D3-0092.xml.zip
i am passing the above variables to a script via... (11 Replies)
Discussion started by: mohanpadamata
11 Replies
6. Shell Programming and Scripting
Hi,
In AIX I have a variable with , (coma) separated values assigned to it like shown below
var1=apple,boy,chris
i want to convert this to
var1='apple','boy','chris'
the number of values assigned to var1 might change and it could be from 1 to n
any suggestions please? (3 Replies)
Discussion started by: rahul9909
3 Replies
7. Shell Programming and Scripting
hi everyone
pls pls help in the query below
it's urgent
pls
-bash-3.00$ abc=deepak
-bash-3.00$ a=1
-bash-3.00$ def_${a}=$abc
-bash: def_1=deepak: command not found
y iti is giving error ? (3 Replies)
Discussion started by: aishsimplesweet
3 Replies
8. Shell Programming and Scripting
Hi
I have a strange problem:
In my shell script I am performing a copy task:
. prop.txt
cp -r $dir/ $dir/archive
$dir is fetched from a property file (prop.txt) which stores its value
dir=/opt/data
Now the problem is another dir1 comes into picture. I only want to add... (1 Reply)
Discussion started by: ankur328
1 Replies
9. Shell Programming and Scripting
#!/bin/sh
if
then
echo "Insufficient number of arguments ">> error".log" ;
echo "Please check error log for more details";
exit 1 ;
else
file_name=$1".csv";
fi ;
in_par_number=`head -n1 $file_name | sed 's///g' | wc -c`
read -a arr <<< `head -n1 $file_name | sed 's// /g'`
... (6 Replies)
Discussion started by: JayDoshi
6 Replies
10. Shell Programming and Scripting
Hi
I am facing a problem.
export local_folder=/opt/app/
cd /opt/app/abc/
abcversion="abc*" (abcga5 is inside /opt/app/abc/)
echo $abcversion (it echoes the correct version as abcga5 )
Now when I reuse the value of abcversion for a below path:
export... (6 Replies)
Discussion started by: ankur328
6 Replies
LEARN ABOUT HPUX
vgexport
vgexport(1M) vgexport(1M)
NAME
vgexport - export an LVM volume group and its associated logical volumes
SYNOPSIS
mapfile] outfile] vg_name
mapfile vg_name
DESCRIPTION
Using the format of the first command line of the above, the command can be used to remove a volume group from the system. The volume
group will be removed without modifying the logical volume information found on the physical volumes.
The volume group identified by vg_name is removed from the or file, and the associated device files including the vg_name directory and
file are removed from the system.
The volume group information and data is untouched on the physical volume. These disks can be imported to another system with the command
(see vgimport(1M)).
Scan Option
Using the format of the second command line of the above, the command generates a mapfile that can be copied to other systems that are part
of a high availability cluster (use the option if you do not want to remove the volume group from the system the command is being run from)
and the command (see vgimport(1M)) can be used to recreate the volume group. See also vgchange(1M). The mapfile contains a description of
the volume group and its associated logical volume(s) (if any). The logical volume information found on the physical volumes is not modi-
fied.
Options and Arguments
recognizes the following options and arguments:
vg_name The path name of the volume group.
By default, a file named
is created in the current directory. This file contains a description of the volume group and its associated logical
volume(s) (if any). Use this option to specify a different name for the file, mapfile. This file can be used as
input to (see vgimport(1M)). When used with the option, the volume group specified in the mapfile can be shared with
other systems in the high availability cluster.
Preview the actions to be taken but do not update the
or file or remove the devices file. This option is best used in conjunction with the option.
Print verbose messages
including the names of the physical volumes associated with this volume group.
Scan option. When the option is specified, then the options must also be specified. A mapfile is created that can be used to cre-
ate volume group entries on other systems in the high availability cluster (with the command).
Write the current set of
pv_paths for the volume group to the outfile. The outfile may then be used as the infile for the option. If used
together with the option the volume group is not exported but the list of pv_paths is still written to the outfile.
This may be useful to derive a list of pv_paths for the volume group or to use on another system which is sharing the
volume group and which has an identical configuration.
EXTERNAL INFLUENCES
Environment Variables
determines the language in which messages are displayed.
If is not specified or is null, it defaults to "C" (see lang(5)).
If any internationalization variable contains an invalid setting, all internationalization variables default to "C" (see environ(5)).
EXAMPLES
Export the volume group into mapfile The volume group will be removed from the exporting system.
Export the volume group and write the disk names into the file
Create a mapfile to be copied to other systems in a high availability cluster to build the volume group information for the volume group,
Note that the volume group is not removed from the exporting system. The importing systems will create the volume group with the command
using the and options.
SEE ALSO
vgimport(1M), vgscan(1M).
vgexport(1M)