Sponsored Content
Top Forums Shell Programming and Scripting How to create files with two or more variables in its names? Post 302847503 by twistedpair on Tuesday 27th of August 2013 06:57:02 AM
Old 08-27-2013
IBM

HI Thanks for reply,

$p is the value iam input iam reading

Code:
my $p = <STDIN>;
print "p: $p:;
open(SHW,">divw_unsigned_$p_50_$k.reset") or die $!;
print SHW "STICK divw_unsigned.cfg_32  ",  ($p==32)&1,  "\n";

I have added a print of $p and it is printing the value given in <STDIN>;
and iam using $p for some operation in the files created and that operation is working fine. Problem is with ONLY file names.

---------- Post updated at 04:27 PM ---------- Previous update was at 04:19 PM ----------

Thanks all for your quick reply.

Code:
open(SHW,">divw_unsigned_${p}_${i}_${k}.reset") or die $!;
or
open(SHW,">divw_unsigned_${p}_${i}_$k.reset") or die $!;
output files generated:
divw_unsigned_44_33_0.reset 
divw_unsigned_44_33_1.reset
divw_unsigned_44_33_2.reset
divw_unsigned_44_33_3.reset



both of these are working. But I want to know why? please educate me on this.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Inserting variables from 2 files to create 1 file

Hi, I have 2 files which are as follows: Num: 548983 748932 783928 547383 839284 Grp: 2389 9873 8493 7382 8493 I need to make an output file using both of these files. (1 Reply)
Discussion started by: rochitsharma
1 Replies

2. UNIX Desktop Questions & Answers

trying to create a script with multiple variables...

I have created a script that prompts the user to enter three variables that are seperated by a space as the delimiter. It then performs a command 3 seperate times for each variable entered. I want the script to llow the user to enter as many variables as they may like and the script to... (5 Replies)
Discussion started by: Italy87
5 Replies

3. Shell Programming and Scripting

Parsing Directory Names for Use as Bash Variables

Hi all: I have a directory where all of the subdirectories are named by the convention "images_#1:#2_Date." My goal is to get an array for each subdirectory that has the structure (#1,#2, int). I am able to use awk to print each subdirectory's values, but cannot figure out how to get them into an... (6 Replies)
Discussion started by: aefskysa
6 Replies

4. Shell Programming and Scripting

AWK: Retrieving names of variables passed with -v

I'm an experienced awk user, but this one has me stumped. I have an awk script which is called from a UNIX command line as you'd expect: myscript.awk -v foo=$1 -v bar=$2 filename My question is this: is there a mechanism for determining the names of the -v variables within a script? ... (3 Replies)
Discussion started by: John Mac
3 Replies

5. Shell Programming and Scripting

Read variables names from array and assign the values

Hi, I have requirement to assign values to variables which are created dynamically. Below is the code which i am using to achieve above requirement. #!/bin/ksh oIFS="$IFS"; IFS=',' STR_FAIL_PARENT_IF_FAILS="WF_F_P_IF_FAILS1,WF_F_P_IF_FAILS2,WF_F_P_IF_FAILS3" set -A... (1 Reply)
Discussion started by: tmalik79
1 Replies

6. Shell Programming and Scripting

Searching for file names with variables

Hello everyone We have a problem about searching and copying files with variables. we have variables like $year $jday $date and we want to search the files whose name contain these variables. we tried *$year*$jday*$date or with ? instead of * thank you everyone!!! (4 Replies)
Discussion started by: miriammiriam
4 Replies

7. 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

8. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

9. Shell Programming and Scripting

awk to create variables to pass into a bash loop to create a download link

I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies

10. Shell Programming and Scripting

Create one xml file from one list of names

Actually I have one list of channels names like: Rai 1 Rai 1 +1HD Rai 1 +2HD Rai 2 Rai 2 +1HD Rai 2 +2HD . . . .From this list of names I need create one new xml file with this structure <channel id="Rai 1"> <display-name lang="it">Rai 1</display-name> <icon... (3 Replies)
Discussion started by: Tapiocapioca
3 Replies
sys_attrs_kevm(5)						File Formats Manual						 sys_attrs_kevm(5)

NAME
sys_attrs_kevm - KEVM (Kernel Event Manager) subsystem attributes DESCRIPTION
This manpage lists and describes attributes for the Kernel Event Manager subsystem. See evm(5) for more information about Event Manager software. An asterisk preceding the name of an attribute in the following list means that the attribute can be configured at run time. Values of other attributes cannot be changed without rebooting the system. A value that can be used to reinitialize all of the attributes. Changing to any non-zero value causes all the attributes to be reset to zero, and then itself is automatically reset to zero. Default value: 0 Minimum value: 0 Maximum value: 2,147,483,647 If you use to change the value of the updated attribute values are not visible until you exit and restart The number of EVM events currently queued in kernel space for collection by the EVM daemon. This attribute is query only. The size (in bytes) of the fixed buffer used to queue any EVM events that are posted while the kernel is executing at interrupt level. Events are moved out of the buffer as soon as the system returns to normal operating mode. The default buffer size should be adequate for most systems. Default value: 65, 536 (bytes) Minimum value: 1 Maximum value: 1,844,674,407,370 A value that indicates whether a process (such as currently has or does not have the interface in an open state. The value 1 means that a process has the interface open (always the case if is running) and the value 0 means that no process has the interface open. This attribute is query only. The major device number being used by the interface. This attribute is query only. The number of EVM events that have been posted in the kernel since the the system was started or the counter was reset. You can reset directly, or by changing to a non-zero value. Minimum value: 0 Maximum value: 2,147,483,647 The number of EVM events that have been read from kernel space by the EVM daemon since the system was started or the counter was reset. You can reset manually or by changing to a non-zero value. Minimum value: 0 Maximum value: 2,147,483,647 The highest number of EVM events that have been queued in kernel space waiting to be collected by the EVM daemon since the system was started or the counter was reset. You can reset manually or by changing to a non-zero value. Minimum value: 0 Maximum value: 2,147,483,647 SEE ALSO
evm(5). System Administration sys_attrs_kevm(5)
All times are GMT -4. The time now is 12:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy