Sponsored Content
Top Forums Programming How to refer to variable (korn shell)? Post 302424774 by fpmurphy on Wednesday 26th of May 2010 09:13:02 AM
Old 05-26-2010
In ksh93, a period in a variable name denotes a compound variable. Since you did not explicitly declare a compound variable, I have used regular variables.

Code:
#!/bin/ksh93

integer dvd=4
integer number=0

while (( dvd ))
do

     eval "let variable\$dvd=$number"
     print "Iteration: $dvd"
     eval print "Variable: \$variable$dvd"

     (( number++,  dvd-- ))
 
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding Occurence of comma in a Variable ( KORN Shell)

All I want to find the occurence of comma in a variable in KORN shell. For example : var = test,test2,test3 .... finding occurence of comma in this variable. Result = 3 now. Please help me to write the code. Thanks in advance. Regards Deepak (2 Replies)
Discussion started by: DeepakXavier
2 Replies

2. Shell Programming and Scripting

how to refer one variable using another

Hi, How will you refer one variable's value using another in unix? For e.g Take the case System1_ip=172.120.20.54 And in latter part of the program while I'm using the values in a for loop I use i=System1 j=${i}_ip k=$j But K's value at the end of the run is System1_ip I want... (2 Replies)
Discussion started by: dayanandra
2 Replies

3. Shell Programming and Scripting

compound variable in korn shell

in a text " Korn Shell Unix programming Manual 3° Edition" i have found this sintax to declare a compoud variable: variable=( fild1 (0 Replies)
Discussion started by: ZINGARO
0 Replies

4. Shell Programming and Scripting

compound variable in korn shell

in a text " Korn Shell Unix programming Manual 3° Edition" i have found this sintax to declare a compoud variable: variable=( fild1 fild1 ) but this sintax in ksh and sh (HP-UNIX) not work... why?? exist another solution for this type of variable ??? (5 Replies)
Discussion started by: ZINGARO
5 Replies

5. Shell Programming and Scripting

Korn Shell Variable values difference

I am using two shell scripts a.ksh and b.ksh a.ksh 1. Sets the value +++++++++++++++++ export USER1=abcd1 export PASSWORD=xyz +++++++++++++++++ b.ksh 2. Second scripts calls sctipt a.ksh and uses the values set in a.ksh and pass to an executable demo... (2 Replies)
Discussion started by: kunalseth
2 Replies

6. Shell Programming and Scripting

Setting variable for query using iSql / Korn Shell

Hi All- First time using iSql. I have 4 query files - some have more than 1 line of sql statements After a bit of research it appears I can just use the -i command and specify the input file. Questions: Does it matter that there are multiple queries in each file? Do I need to have... (3 Replies)
Discussion started by: Cailet
3 Replies

7. Shell Programming and Scripting

korn shell: check the content of a string of a variable

hello, i have a variable which should have following content : var="value1" or var="value2" or var="value2:*" # example: value2:22 how can i check : - if the content is ok (value1 / value2* ) - the two options of "value2" when content is example "value2:22" , i want to split... (3 Replies)
Discussion started by: bora99
3 Replies

8. Shell Programming and Scripting

Korn Shell help - Using parameter to create variable names

I'm using korn shell and I am wondering if it's possible to use a parameter passed into a function to build a variable name in a configuration file. I have the function in one source file, I'd like to have a global configuration file instead of hardcoding logins to each script. So I have a... (7 Replies)
Discussion started by: mrevello
7 Replies

9. UNIX for Dummies Questions & Answers

How to import a variable Used in Another Korn Shell Script?

Hi I am using two shell scripts which are running on the system simultaneously. And in one of the script i am exporting an Integer Variable. Now i want to use the variable in another script. But i cannot run the first script in the second as the first script has many other functions which... (3 Replies)
Discussion started by: Ajesh
3 Replies

10. Shell Programming and Scripting

[Solved] How to refer more than 9 command line inputs for a scripts in korn shell?

Hi all, I have a script which should take more than 9 command line inputs while running. Likescript.sh a s d f g h j j k l o p i u y t r e w Now in the script if I have to access one of the input which is at position after 9, in this case say 'p' then how can I do that? echo $12 will not work... (15 Replies)
Discussion started by: pat_pramod
15 Replies
VOBCOPY(1)							   User Manuals 							VOBCOPY(1)

NAME
vobcopy - copy (rip) files from a dvd to the harddisk SYNOPSIS
vobcopy [-b size[bkmg] ] [-e size[bkmg] ] [-f] [-F fast_factor ] [-h] [-i input-dir ] [-l] [-m] [-M][-n title-number ] [-o output-dir ] [-q] [-O single_file(s)_to_rip ] [-t name ] [-v [-v]] [-x] [-I] [-V] [-L logfile-path ] [-1 aux_output_dir1 ] [-2 aux_output_dir2 ] [-3 aux_output_dir3 ] [-4 aux_output_dir4 ] DESCRIPTION
vobcopy copies DVD .vob files to harddisk (thanks to libdvdread) and merges them into file(s) with the name extracted from the DVD. It checks for enough free space on the destination drive and compares the copied size to the size on DVD (in case the size is wrong the files keep the .partial ending ). It should definitely work on linux and now on FreeBSD, OpenBSD, NetBSD, Solaris and MacOSX too! theCSSissue: Due to possible legal issues, vobcopy doesn't include any code to descramble CSS "enhanced" DVDs. CSS is sold by the DVD industry as a "copy protection", though it's more of a "view protection" as it makes DVDs unviewable with unlicensed players. Some people have hacked CSS decryption routines, and one of those is available as a libdvdread counterpart. So if you have such a DVD, have a look at the libdvdread page. If you are positive that it's allowed where you live, you can just install that mentioned library and make decrypted backups of all your DVDs... vobcopy without any options will copy the title with the most chapters into files of 2GB size into the current working directory. OPTIONS
-b, --begin SIZE[bkmg] begins to copy from the specified offset-size. Modifiers like b for 512-bytes, k for kilo-bytes, m for mega- and g for giga-bytes can be appended to the number. Example: vobcopy -b 500m will start to copy from 500MB onward till the end. -e, --end SIZE[bkmg] similar to -b, this options lets you specify some size to stop before the end. -f, --force force the output to the specified directory even if vobcopy thinks there is not enough free space -F, --fast fast_factor speed up the copying (experimental). fast_factor is in the range 1 to 64 -h, --help print the command line options available -i, --input-dir INPUT-DIR provide vobcopy with the path to the mounted dvd drive -l, --large-file write data into one file (needs large file support (LFS)) -M, --longest choose the title with the longest playing time. With some DVDs this gets the main title better than the most chapter method, with others it's worse. -m, --mirror mirrors the whole dvd to harddisk. It will create a directory named after the dvd and copy the ifo, bup and vob files there. The title-vobs are decrypted during this. -n, --title-number TITLE-NUMBER specify which title vobcopy shall copy (default is title with most chapters). On the dvd, vts_01_x.vob specify the first title (mostly this is the main feature). -o, --output-dir OUTPUT-DIR specify the output-directory of the data. "stdout" or "-" redirect to stdout. Useful for pipeing it to /dev/null ;-) If you forget to pipe it to some place, your terminal will get garbled, so remember that typing "reset" and then Enter will rescue you. -q, --quiet all info- and error-messages of vobcopy will end up in the current directory in vobcopy.bla instead of stderr -O, --onefile single_file(s)_to_rip specify which single file(s) to rip. Parts of names can be given and all files which include the part will be copied. Files can be listed with comma separation. Example: -O video_ts.vob,bup will copy the single file video_ts.vob and all files containing bup -t, --name NAME you can give the file a name if you don't like the one from dvd. -t hallo will result in hallo.vob. (stdout or "-" are deprecated now) If you want to give it names like "Huh I like this movie", do it in quotation marks. -v, --verbose prints more information about whats going on (more verbose). -v -v prints the information given on command line into a log-file in the current directory for inclusion into a bugreport. -x overwrite all existing files without further questions. -L LOGFILE-PATH tells vobcopy where to put the logfile instead of the default. -I, --info prints information about the titles, chapters and angles on the dvd. -V, --version prints version number. -1, --1st_alt_output_dir AUXILIARY-OUTPUT-DIR1 if the data doesn't fit on the first output-directory (specified behind -o) writing will continue here (and after -2 there and -3 and -4) -> the files will be split according to the remaining free space (try specifying the path _directly_ behind -1, _no_ space in between if you have troubles, this might be even necessary at -o...) BUGS
Vobcopy is still under development. So expect some. There *might* be problems for users who's system is not large-file ready. If so, please get back to me. AUTHOR
Robos <robos@muon.de> Linux Jun 2009 VOBCOPY(1)
All times are GMT -4. The time now is 03:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy