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
OPENCHANGEPFADMIN(1)					     OpenChange Users' Manual					      OPENCHANGEPFADMIN(1)

NAME
openchangepfadmin - Exchange users and Public Folder administration tool SYNOPSIS
openchangepfadmin [-?] [-?|--help] [--usage] [-f|--database PATH] [-p|--profile PROFILE] [-P|--password PASSWORD] [--apassword=PASSWORD] [--adesc=DESCRIPTION] [--acomment=COMMENT] [--afullname=NAME] [--list] [--mkdir] [--rmdir] [--comment=COMMENT] [--dirclass=CLASS] [--adduser=USERNAME] [--rmuser=USERNAME] [--addright=RIGHT] [--rmright] [--modright=RIGHT] [--debuglevel=LEVEL] [--dump-data] [--folder=FOLDER] [--username=USERNAME] DESCRIPTION
openchangepfadmin is a administrative command line tool designed to facilitate user management related operations (create, delete, modify) on a remote Exchange server and manage public folder store and permissions. COMMANDS
--adduser=USERNAME Create a Exchange user with the username specified by USERNAME --rmuser=USERNAME Delete the Exchange user account specified by USERNAME --list List Public Folder hierarchy (IPM_SUBTREE) --mkdir Create a folder in the Public Folder store --rmdir Delete a folder in the Public Folder store --addright=RIGHT Add permission and roles for a user on a Public Folder directory. --modright=RIGHT Modify permissions and roles for a user on a Public Folder directory --rmright Delete permissions and roles for a specific user OPTIONS
--database=DATABASE -f Set the MAPI profile database. If no database is specified, then openchangeclient tries to load the default one: $HOME/.open- change/profiles.ldb --profile=PROFILE -p Set the profile to use. If a profile is not specified, and one of the profiles has been set as the default in the profile database (for example, using mapiprofile -S), then that default profile will be used. --password -P Set the password for the profile to use. This can be omitted if the password is stored in the profile. --apassword=PASSWORD Define the password to set for the user specified with --adduser. If no password is explicitely supplied, openchangepfadmin will arbitrary set a random one. --adesc=DESCRIPTION This command can only be used with --adduser and specifies a description for this account --acomment=COMMENT This command can only be used with --adduser and specifies a comment for this account. --afullname=NAME This command can only be used with --adduser and specifies the user full name for this account. --comment=COMMENT This command can only be used with --mkdir and specifies a comment for the folder. --dirclass=CLASS This command can only be used with --mkdir and specifies the container class of the directory we want to create. Possible values are: IPF.Appointment, IPF.Contact, IPF.Journal, IPF.Note, IPF.StickyNote, IPF.Task, IPF.Post --folder=FOLDER This command can only be used with --addright, --modright and --rmright. Specify the folder where permissions and roles have to be changed. --username=USERNAME This command can only be used with --addright, --modright and --rmright. Specify the username we want to change permissions and roles for. --dump-data Dump the hex data. This is only required for debugging or educational purposes. --debuglevel LEVEL -d Set the debug level. EXAMPLES
Creating user openchangepfadmin --adduser=linuxowner --apassword=linuxowner --adesc="Linux Owner Test account" --afullname="Linux Owner" mapiadmin_user_add : MAPI_E_SUCCESS (0x0) username: linuxowner password: linuxowner Creates a user account with username and password set to linuxowner. Deleting user: openchangepfadmin --rmuser=linuxowner mapiadmin_user_del : MAPI_E_SUCCESS (0x0) Create Public Folder: openchangepfadmin --mkdir --folder=public_events --dirclass=IPF.Appointment Creates a folder in the Public Folder store named public_events with a container class set to Appointment. This folder will display calen- dar items. Delete Public Folder: openchangepfadmin --rmdir --folder=public_events List Public Folder hierarchy: openchangepfadmin --list Add Permission: openchangepfadmin --username=linuxowner --folder=public_events --addright=RoleOwner Permission RoleOwner added for linuxowner on folder public_events Modify Permission openchangepfadmin --username=Anonymous --folder=public_events --modright=RoleNone Permission changed to RoleNone for Anonymous on folder appointment Note that you can only change permissions for a user already listed in the ACL table. NOTE
Permissions and Roles possible values are: o RightsNone o RightsReadItems o RightsCreateItems o RightsEditOwn o RightsDeleteOwn o RightsEditAll o RightsDeleteAll o RightsCreateSubfolders o RightsFolderOwner o RightsFolderContact o RoleNone o RoleReviewer o RoleContributor o RoleNoneditingAuthor o RoleAuthor o RoleEditor o RolePublishAuthor o RolePublishEditor o RightsAll o RoleOwner SEE ALSO
AddUserPermission, ModifyUserPermission, RemoveUserPermission AUTHOR
Julien Kerihuel <j.kerihuel at openchange dot org> OpenChange 2.0 QUADRANT 2013-01-24 OPENCHANGEPFADMIN(1)
All times are GMT -4. The time now is 03:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy