Sponsored Content
Top Forums Shell Programming and Scripting capturing a file to store in a variable Post 302336251 by rechever on Tuesday 21st of July 2009 04:30:44 PM
Old 07-21-2009
capturing a file to store in a variable

I have a file in a windows directory the file is delivery to us like this
07210900.dat
where
07210900 is the current date.
If I want to store that file in a variable UpLoadFileName and
rename, so I can Ftp later to a UNIX directory, I am doing this, is this correct?

Code:
CDRemoteDir='cd alumni\xxxx\xxx\0910\FTP'
UpLoadFileName=`date "+%m%d%y"00.dat`;
NewName= "eluppdtop.dat" ;

Thank you

Last edited by rechever; 07-21-2009 at 05:50 PM.. Reason: fixed code tag
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to read each letter from file and store it in variable.

Dear friends, i am writing csh script i have one dat file containing following data.like this. 08FD3 03A26 000FA0 FFFF0 BBA0F 00000 00000 from the above file i want to read each letter and store it in one variable. how it is possible. please help (7 Replies)
Discussion started by: rajan_ka1
7 Replies

2. UNIX for Dummies Questions & Answers

Capturing some data from a file into a variable

I have a file with some values in a tab delimted format Eg: 'test' contains: a<tab>b<tab>c<tab>Trk_12345678 now i need to capture this value 'Trk_12345678' into a variable say 'x' and append that value of 12345678 to 12345679 and store is back to a new 'test1' file as : 'test1'... (11 Replies)
Discussion started by: shiroh_1982
11 Replies

3. Shell Programming and Scripting

store the first line of a file in a variable

i have to store the files in a folder and assign a variable to the the files. (0 Replies)
Discussion started by: dineshr85
0 Replies

4. Shell Programming and Scripting

Capturing a number at the end of line and store it as variable

Hello, Would someone guide me on how to write a shell script the would search for a phone no using at the end text file using sed or awk and store it in a varaible or print it. The text file is in this form text or numbers in first line text or numbers in second line . . . Firsname... (6 Replies)
Discussion started by: amuthiga
6 Replies

5. UNIX for Dummies Questions & Answers

Read a file and store each value in a variable

Hi, How to read a file and put the values in a script. E.g. file1.txt 02/12/2009;t1;t2 The script should read this file and put these values in 3 different variables x1,x2,x3 which can be used further. Thanks Ashu (3 Replies)
Discussion started by: er_ashu
3 Replies

6. Shell Programming and Scripting

Read the contents of a file and store them in a variable

Hi Gurus, I am trying for a scenario where in I want to read the contents of a file line by line and then store them in variables. Below is the script: #!/bin/ksh while read line do id=`echo $line | cut -f1 -d |` name=`echo $line | cut -f2 -d |` echo $id ... (11 Replies)
Discussion started by: svajhala
11 Replies

7. Shell Programming and Scripting

To store the file name o/p from find command in to a variable

Hi How to use a variable to store the filename of a file which was found by the 'find' command. can this be practical-->var = find . -name "filename.dat" Please help.. (1 Reply)
Discussion started by: ayyappaas
1 Replies

8. Shell Programming and Scripting

Extract a string from a file and store it in variable

Hi, I've a file ImageSizeDetails.txt with the following contents: Image Name: swncd 01.10.00.04 Created: Wed Jan 9 14:05:48 2013 Image Type: ARM Linux Multi-File Image (gzip compressed) Data Size: 7351011 Bytes = 7178.72 kB = 7.01 MB Load Address: 00008000 Entry Point: ... (6 Replies)
Discussion started by: Parameswaran
6 Replies

9. Shell Programming and Scripting

How to read a value from a file and store in a variable?

Hi, I have a file service.xml which has following content: <?xml version="1.0" encoding="UTF-8"?> <Service Ver="2.31.13"/> I want to read the value of Ver (that is 2.31.13) and assign to a variable which i further use. Please help me in that. (3 Replies)
Discussion started by: laxmikant15
3 Replies

10. Shell Programming and Scripting

How to store file name in a variable?

Hi All, Daily I am generating a file dfm_daily_file_ ex: dfm_daily_file_05072015 date will be changed daily. Once the file is FTP it is deleted. I have tried the below code to get the file name with any date and store it in a variable its not working. #!/bin/ksh ... (4 Replies)
Discussion started by: ROCK_PLSQL
4 Replies
datadm(1M)						  System Administration Commands						datadm(1M)

NAME
datadm - maintain DAT static registry file SYNOPSIS
/usr/bin/datadm [-v] [-u] [-a service_provider.conf] [-r service_provider.conf] DESCRIPTION
The datadm utility maintains the DAT static registry file, dat.conf(4). This administrative configuration program allows uDAPL service providers to add and remove themselves to the dat.conf file. You can add or remove interface adapters that a service provider supports from a system after its installation. You can use datadm to update the dat.conf file to reflect the current state of the system. A new set of interface adapters for all the service providers cur- rently installed is regenerated. OPTIONS
The following options are supported: -a service_provider.conf Enumerate each device entry in the service_provider.conf(4) file into a list of interface adapters, that is, interfaces to external network that are available to uDAPL consumers. -r service_provider.conf Remove the list of interface adapters that corresponds to the device entry in the service_provider.conf(4) file. -u Update the dat.conf to reflect the current state of the system with an up to date set of interface adapters for the service providers that are currently listed in the DAT static registry. -v Display the DAT static registry file, dat.conf. EXAMPLES
Example 1 Enumerating a Device Entry The following example enumerates a device entry in the service_provider.conf(4) file into interface adapters in the dat.conf(4) file. Assume that SUNW has a service provider library that supports the device tavor. It has a service_provider.conf(4) file installed in the directory /usr/share/dat/SUNWudaplt.conf with a single entry as follows: driver_name=tavor u1.2 nonthreadsafe default udapl_tavor.so.1 SUNW.1.0 "" tavor is an Infiniband Host Channel Adapter with two ports. Both IB ports exist in a single IB partition, 0x8001. If an IP interface is plumbed to each port, there are two IPoIB device instances, ibd0 and ibd1: # ls -l /dev/ibd* /dev/ibd0 -> /devices/pci@1/pci15b3,5a44@0/ibport@1,8001,ipib:ibd0 /dev/ibd1 -> /devices/pci@1/pci15b3,5a44@0/ibport@2,8001,ipib:ibd1 Running the command, datadm -a /usr/share/dat/SUNWudaplt.conf appends two new entries (if they do not already exists]) in the /etc/dat/dat.conffile: ibd0 u1.2 nonthreadsafe default udapl_tavor.so.1 SUNW.1.0 "" "driver_name=tavor" ibd1 u1.2 nonthreadsafe default udapl_tavor.so.1 SUNW.1.0 "" "driver_name=tavor" Example 2 Updating the dat.conf to Reflect the Current State of the System A new IB partition, 0x8002 is added to the above example covering port 1 of the Host Channel Adapter. If a new IP interface is plumbed to port 1/partition 0x8002, there is a third IPoIB device instance: ibd2. # ls -l /dev/ibd* /dev/ibd0 -> /devices/pci@1/pci15b3,5a44@0/ibport@1,8001,ipib:ibd0 /dev/ibd1 -> /devices/pci@1/pci15b3,5a44@0/ibport@2,8001,ipib:ibd1 /dev/ibd2 -> /devices/pci@1/pci15b3,5a44@0/ibport@1,8002,ipib:ibd2 Running datadm -u command, updates the /etc/dat/dat.conf file with a new entry added reflecting the current state of the system. datadm -v shows that there are now three entries in the /etc/dat/dat.conf file: ibd0 u1.2 nonthreadsafe default udapl_tavor.so.1 SUNW.1.0 "" "driver_name=tavor" ibd1 u1.2 nonthreadsafe default udapl_tavor.so.1 SUNW.1.0 "" "driver_name=tavor" ibd2 u1.2 nonthreadsafe default udapl_tavor.so.1 SUNW.1.0 "" "driver_name=tavor" FILES
/etc/dat/dat.conf DAT static registry file ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWudaplu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
pkgadd(1M), pkgrm(1M), libdat(3LIB), dat.conf(4), service_provider.conf(4). attributes(5) SunOS 5.11 18 Jun 2004 datadm(1M)
All times are GMT -4. The time now is 07:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy