Sponsored Content
Top Forums Shell Programming and Scripting awk issue while reading from file in while do Post 302768013 by Yoda on Thursday 7th of February 2013 11:38:44 PM
Old 02-08-2013
Quote:
Originally Posted by narunice
in case if i user comma seperated in my file the i have to use

"while read DBNAME,USERNAME,PASSWORD"

Is it Right?
No, that is not correct.

If your file has comma separated entries, then use IFS
Code:
while IFS=, read DBNAME USERNAME PASSWORD

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Issue reading csv file

HI All I have csv file containing the data like this Electrical Equipment,ElecEquip "Engineering, Machinery & Equipment",Engineerin Entertainment & Broadcasting,Entertain The first and third record are fine,The issue with second records as it has comma enclosed with in inverted... (1 Reply)
Discussion started by: mohdtausifsh
1 Replies

2. UNIX for Dummies Questions & Answers

issue on reading the file and appending date

Hi Am having issue on appending time stamp I know the exact file names in the directory like a.dat b.dat c.dat e.dat f.dat I want to read all these file names and append the timestamp to each files like a.dat.20090604,b.dat.20090604 and move to the different directory. ... (3 Replies)
Discussion started by: bobprabhu
3 Replies

3. Shell Programming and Scripting

Using awk to when reading a file to search and output to file

Hi, I am not sure if this will work or not. I am getting a syntax error. I am reading fileA, using an acct number field trying to see if it exists in fileB and output to new file. Can anyone tell me if what I am doing will work or should I attempt it another way? Thanks. exec < "${fileA}... (4 Replies)
Discussion started by: ski
4 Replies

4. Shell Programming and Scripting

Reading a file several times with awk

Hi everyone, I was wondering if it's possible to read a file ("file2" in my example) more than once. In this example I want to print file2 entirely for each lines of file1: awk -F$'\t' '{ print $0 while ((getline < "file2") > 0) { print "\t"$0 } }' file1 It... (4 Replies)
Discussion started by: anthony.cros
4 Replies

5. Shell Programming and Scripting

UNIX File handling -Issue in reading a file

I have been doing automation of daily check activity for a server, i have been using sqls to retrive the data and while loop for reading the data from the file for several activities. BUT i got a show stopper the below one.. where the data is getting store in $temp_file, but not being read by while... (1 Reply)
Discussion started by: KuldeepSinghTCS
1 Replies

6. Shell Programming and Scripting

awk- reading input file twice

Hello, I've been trying to come up with a solution for the following problem; I have an input file with two columns and I want to print as an output the first column without any changes but for the second column, I want to divide it by its last value. Example input: 1 9 2 10 3 11 4 12 5... (14 Replies)
Discussion started by: acsg
14 Replies

7. Shell Programming and Scripting

awk file reading doubt

Hi, Using this trivial code, I am trying to insert/paste the single column data of a file into the second column (field 2) of a multi-column text file. awk 'FNR==NR {a=$0; next} {$1=$1 OFS a}1' single-column-file multi-column-file Lets consider the single-column-file as 'f2' and multi-column... (1 Reply)
Discussion started by: royalibrahim
1 Replies

8. Shell Programming and Scripting

reading file awk or while

While read line query !!! Folks, I am working on a file which has entries as follows. I am using while read line to generate desired output as follows. filename1: Name : sdt2156157_ID NOS : 4567 NOS : 2348 Name : sdt2156158_ID NOS : 4987 NOS :... (3 Replies)
Discussion started by: dynamax
3 Replies

9. Shell Programming and Scripting

Reading data from file using awk

I have a file as below. It contains two data sets separated by >. I want to pipe each data set to another program called psxy. How can I get the different records Have started doing as follows but it only passes the first data set awk 'BEGIN {RS=">"};{print $0}' p.dat cat p.dat... (12 Replies)
Discussion started by: kristinu
12 Replies

10. Shell Programming and Scripting

Issues in reading file using 'awk'

Dear all, I am using following function of some script to assign variable "JobNo" some value form file $SAMPLE"_status.log" ( generated using the red color command ) crab ntuplize_crab -status -c $SAMPLE >& $SAMPLE"_status.log" & echo $SAMPLE"_status.log" "=====" jobNo=$(awk... (10 Replies)
Discussion started by: emily
10 Replies
Authen::DecHpwd(3pm)					User Contributed Perl Documentation				      Authen::DecHpwd(3pm)

NAME
Authen::DecHpwd - DEC VMS password hashing SYNOPSIS
use Authen::DecHpwd qw( UAI_C_AD_II UAI_C_PURDY UAI_C_PURDY_V UAI_C_PURDY_S lgi_hpwd ); $hash = lgi_hpwd("JRANDOM", "PASSWORD", UAI_C_PURDY_S, 1234); use Authen::DecHpwd qw(vms_username vms_password); $username = vms_username($username); $password = vms_password($password); DESCRIPTION
This module implements the "SYS$HASH_PASSWORD" password hashing function from VMS (also known as "LGI$HPWD"), and some associated VMS username and password handling functions. The password hashing function is implemented in XS, with a hideously slow pure Perl backup version for systems that can't handle XS. FUNCTIONS
UAI_C_AD_II UAI_C_PURDY UAI_C_PURDY_V UAI_C_PURDY_S These constants are used to identify the four password hashing algorithms used by VMS. They are the "UAI$C_" constants in VMS. "UAI_C_AD_II" refers to a 32-bit CRC algorithm. The CRC polynomial used is the IEEE CRC-32 polynomial, as used in Ethernet, and in this context is known as "AUTODIN-II". The hash is merely the CRC of the password. "UAI_C_PURDY", "UAI_C_PURDY_V", and "UAI_C_PURDY_S" refer to successive refinements of an algorithm based on Purdy polynomials. All of these algorithms use the salt and username parameters as salt, use the whole password, and return an eight-byte (64-bit) hash. The main part of the algorithm, the Purdy polynomial, is identical in all three. They differ in the pre-hashing, particularly in the treatment of the username parameter. In "UAI_C_PURDY" the username is truncated or space-padded to 12 characters before being hashed in. "UAI_C_PURDY_V" accepts a variable-length username. "UAI_C_PURDY_S" accepts a variable-length username and also includes the password length in the hash. "UAI_C_PURDY_S" also does some extra bit rotations when hashing in the username and password strings, in order to avoid aliasing. lgi_hpwd(USERNAME, PASSWORD, ALGORITHM, SALT) This is the "SYS$HASH_PASSWORD" function from VMS (also known as "LGI$HPWD"), but with the parameters in a different order. It hashes the PASSWORD string in a manner determined by the other parameters, and returns the hash as a string of bytes. ALGORITHM determines which hashing algorithm will be used. It must be the value of one of the algorithm constants supplied by this module (see above). SALT must be an integer in the range [0, 2^16). It modifies the hashing so that the same password does not always produce the same hash. USERNAME is a string that is used as more salt. In VMS it is the username of the account to which the password controls access. VMS usernames and passwords are constrained in character set and length, and are case-insensitive. This function does not enforce these restrictions, nor perform canonicalisation. If restrictions and canonicalisation are desired then they must be applied separately. The functions "vms_username" and "vms_password" described below may be useful. vms_username(USERNAME) Checks whether the USERNAME string matches VMS username syntax, and canonicalises it. VMS username syntax is 1 to 31 characters from case-insensitive alphanumerics, "_", and "$". If the string has correct username syntax then the username is returned in canonical form (uppercase). If the string is not a username then "undef" is returned. vms_password(PASSWORD) Checks whether the PASSWORD string is an acceptable VMS password, and canonicalises it. VMS password syntax is 1 to 32 characters from case-insensitive alphanumerics, "_", and "$". If the string is an acceptable password then the password is returned in canonical form (uppercase). If the string is not an acceptable password then "undef" is returned. SEE ALSO
VMS::User AUTHOR
The original C implementation of "LGI$HPWD" was written by Shawn Clifford. The code has since been developed by Davide Casale, Mario Ambrogetti, Terence Lee, Jean-loup Gailly, Solar Designer, and Andrew Main (Zefram). Mike McCauley <mikem@open.com.au> created the first version of "Authen::DecHpwd", establishing the Perl interface. This was based on Shawn Clifford's code without the later developments. Andrew Main (Zefram) <zefram@fysh.org> created a new "Authen::DecHpwd" based on the more developed C code presently used, and added ancillary functions. COPYRIGHT
Copyright (C) 2002 Jean-loup Gailly <http://gailly.net> Based in part on code from John the Ripper, Copyright (C) 1996-2002 Solar Designer Copyright (C) 2006, 2007, 2009, 2010, 2011 Andrew Main (Zefram) <zefram@fysh.org> LICENSE
This module is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. perl v5.14.2 2011-11-15 Authen::DecHpwd(3pm)
All times are GMT -4. The time now is 03:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy