Sponsored Content
Top Forums Shell Programming and Scripting dynamic variables - eval - expand etc. Post 302508080 by TehOne on Friday 25th of March 2011 04:03:53 PM
Old 03-25-2011
Thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Dynamic variables within shell script

Hi Gurus, I have a requirement of writting the shell script where it should ask me two values FND_TOP=/d02/app/oracle/xxx/fnd/11.5.0 CDCRM_TOP=/d02/app/oracle/xxx/cdcrm/11.5.0 and then keep these values stored as variables for the execution of rest of the script. Because, I have to... (2 Replies)
Discussion started by: isingh786
2 Replies

2. UNIX for Dummies Questions & Answers

dynamic variables

I am new to unix and the following problem is bugging me.:confused: var1="hello1" var2="hello2" var3="hello3" counter=1 while do echo $var$counter done the idea here is to display the value of "var" based on the counter. I am using the korn shell. I used array here but the... (4 Replies)
Discussion started by: max_payne1234
4 Replies

3. Programming

global variables and dynamic allocation

Hi, is it possible in C to allocate dynamically a global variable?? (3 Replies)
Discussion started by: littleboyblu
3 Replies

4. UNIX for Dummies Questions & Answers

how to expand environment variables in a file?

I am new to unix and would appreciate if someone could help. I have an environment variable SourceFilePath=/db1/Src/test set on the unix server. I want to expand this SHELL variable in a file using any command sed, awk etc File contents is as follows: var=$SourceFilePath/file.txt ... (2 Replies)
Discussion started by: debbie15
2 Replies

5. Shell Programming and Scripting

Problem with dynamic variables outside the loop

Hi All, Shell is ksh I've given portion of the script here to explain the problem. It will accept 2 input parameters . in_file1=$1 in_file2=$2 outbound_dir=/home/outbound for i in 1 2 do eval file$i=$outbound_dir/\$in_file$i eval echo "filename is \$file$i" ... (4 Replies)
Discussion started by: kk17
4 Replies

6. Shell Programming and Scripting

Dynamic variables and eval

Hi, I need some direction with the following. The below code is semi-psuedo code which will hopefully make it easier to understand what I am trying to achieve: for i in `echo ${testarray }` do let c=c+1 eval "first$c=$i" while... (4 Replies)
Discussion started by: yonderboy
4 Replies

7. Shell Programming and Scripting

For loop using input file doesn't expand variables

Hi, I'm using a for loop reading from an input file that contains files, whose path includes a variable name. But the for loop doesn't expand the variable and therefore can't find the file. Here's an example: File BACKUPFILES /home/John/alpha /home/Sue/beta... (8 Replies)
Discussion started by: Hesiod
8 Replies

8. Shell Programming and Scripting

Generating dynamic variables

Hi , i am unable to generate dynamic variables can any one please help me on the below issue j=1 {record_count_"$j"}=`db2 -xselect substr\(job_name,24\) rec_count from $libname.audit_table_nrt where job_name like \'DATAMART_DEL_RUN%\' and STS_FLAG=\'E\' and seq_no=$i` echo " record... (3 Replies)
Discussion started by: bhaskar v
3 Replies

9. UNIX for Beginners Questions & Answers

Expand Variables and Wildcards into another variable.

Dear Forum members, I am having trouble getting the complete filename (and directory path) in a variable. Output directory mentioned in the code have three files: DISPLAY_CITY_DETAILS_15-05-2019-08-29-26_MIGRATE_london.out DISPLAY_CITY_DETAILS_15-05-2019-08-29-26_MIGRATE_paris.out... (4 Replies)
Discussion started by: chetanojha
4 Replies

10. UNIX for Beginners Questions & Answers

[BASH] eval command not expanding variables as expected.

Hi Guys, I wrote a collection of bash functions years ago and now need to use them again but I'm getting some error messages when eval tries to expand the variables names. I recollect that I used the shopt command to set one of the options but I can't quite remember the command that I... (8 Replies)
Discussion started by: ASGR
8 Replies
EXPAND(1)						    BSD General Commands Manual 						 EXPAND(1)

NAME
expand, unexpand -- expand tabs to spaces, and vice versa SYNOPSIS
expand [-t tab1,tab2,...,tabn] [file ...] unexpand [-a | -t tab1,tab2,...,tabn] [file ...] DESCRIPTION
The expand utility processes the named files or the standard input writing the standard output with tabs changed into blanks. Backspace characters are preserved into the output and decrement the column count for tab calculations. The expand utility is useful for pre-process- ing character files (before sorting, looking at specific columns, etc.) that contain tabs. The unexpand utility puts tabs back into the data from the standard input or the named files and writes the result on the standard output. The following options are available: -a (unexpand only.) By default, only leading blanks and tabs are reconverted to maximal strings of tabs. If the -a option is given, then tabs are inserted whenever they would compress the resultant file by replacing two or more characters. -t tab1,tab2,...,tabn Set tab stops at column positions tab1, tab2, ..., tabn. If only a single number is given, tab stops are set that number of column positions apart instead of the default number of 8. ENVIRONMENT
The LANG, LC_ALL and LC_CTYPE environment variables affect the execution of expand and unexpand as described in environ(7). EXIT STATUS
The expand and unexpand utilities exit 0 on success, and >0 if an error occurs. STANDARDS
The expand and unexpand utilities conform to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
The expand command appeared in 3.0BSD. BSD
October 13, 2006 BSD
All times are GMT -4. The time now is 07:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy