Sponsored Content
Full Discussion: Unix
Special Forums UNIX and Linux Applications Unix Post 302146707 by ratna on Thursday 22nd of November 2007 12:20:29 AM
Old 11-22-2007
Unix

Hi,

Following is the code.

Test.sh
-------
lindata=""
cnt=`cat test.dat|wc -l`
i=1
while [ $i -le $cnt ];
do
v=`head -$i test.dat|tail -1`
echo $v
i=`expr $i + 1`
done
exit

I am having the data like this
Test.dat
--------
smith
jones xxxxx
smith jones "N/A "
"smith b "
'jones '

When i execute the test.sh, I got the following output:
smith
jones xxxxx
smith jones "N/A "
"smith b "
'jones '

Here the issue is spaces are removed as u check the test.dat and the output i got when i execute the statement. I want to display the output as the test.dat but it is not displaying.

Please suggest.

Thanks & Regards
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

UNIX problem? Unix programm runs windows 2000 CPU over 100%

Okee problems...!! What is happening: Unix server with some programms, workstations are windows 2000, the workstations work good but when you start a programm on the Unix server the CPU of the workstations go to 100% usage resulting that the system gets very slow. The programm well its running so... (2 Replies)
Discussion started by: zerocool
2 Replies

2. UNIX for Dummies Questions & Answers

Unix History Question: Why are filenames/dirnames case sentsitive in Unix?

I tried looking for the answer online and came up with only a few semi-answers as to why file and directory names are case sensitive in Unix. Right off the bat, I'll say this doesn't bother me. But I run into tons of Windows and OpenVMS admins in my day job who go batty when they have to deal... (3 Replies)
Discussion started by: deckard
3 Replies

3. UNIX for Advanced & Expert Users

missing Path(in UNIX) when i launch a job on to unix machine using windows SSh

hi i want run an unix application from a windows program/application.i am using SSH(command line version)to log on to a unix machine from windows. the application has to read a configuration file inorder to run. the configuration file .CFG is in bin in my home directory. but the application... (1 Reply)
Discussion started by: megastar
1 Replies

4. Shell Programming and Scripting

FTP script for sending a file from one unix directory to another unix server director

Hi, My local server is :/usr/abcd/ Remote server is :/Usr/host/test/ I want to send files from local unix directory(All files starting with O_999) to remote host unix directory. Can any body give me the Unix Shell script to do this. One more doubt: Shall we need to change the file... (1 Reply)
Discussion started by: raja_1234
1 Replies

5. Shell Programming and Scripting

Batch job in unix server to move the pdf file from unix to windows.

Hi Experts, I have a requirement where i need to setup a batch job which runs everymonth and move the pdf files from unix server to windows servers. Could some body provide the inputs for this. and also please provide the inputs on how to map the network dirve in the unix like that... (1 Reply)
Discussion started by: ger199901
1 Replies

6. UNIX for Dummies Questions & Answers

How does unix system administration, unix programming, unix network programming differ?

How does unix system administration, unix programming, unix network programming differ? Please help. (0 Replies)
Discussion started by: thulasidharan2k
0 Replies

7. Shell Programming and Scripting

File Transfer from Window server to UNIX and UNIX to UNIX

Dear All, Can someone help to command or program to transfer the file from windows to Unix server and from one unix server to another Unix server in secure way. I would request no samba client. (4 Replies)
Discussion started by: yadavricky
4 Replies

8. Post Here to Contact Site Administrators and Moderators

VIP Membership - The UNIX and Linux Forums - Get Your UNIX.COM Email Address Here

We work hard to make The UNIX and Linux Forums one of the best UNIX and Linux knowledge sources on the net. The site is certainly one of the top UNIX and Linux Q&A sites on the web. In order to provide certain members the best quality account services, you can now get some great extra features by... (2 Replies)
Discussion started by: Neo
2 Replies
PTS_ADDUSER(1)						       AFS Command Reference						    PTS_ADDUSER(1)

NAME
pts_adduser - Adds a user or machine to a Protection Database group SYNOPSIS
pts adduser -user <user name>+ -group <group name>+ [-cell <cell name>] [-noauth] [-localauth] [-force] [-help] pts ad -u <user name>+ -g <group name>+ [-c <cell name>] [-n] [-l] [-f] [-h] DESCRIPTION
The pts adduser command adds each user or machine entry named by the -user argument as a member of each group named by the -group argument. To remove members of a group, use the pts removeuser command. To list the groups to which a user or machine belongs, or the members of a specified group, use the pts membership command. CAUTIONS
After being added as a group member, a currently authenticated user must reauthenticate (for example, by issuing the aklog or klog.krb5 commands) to obtain permissions granted to the group on an access control list (ACL). OPTIONS
-user <user name>+ Specifies the name of each user or machine entry to add to each group named by the -group argument. The name of a machine entry resembles an IP address and can use the wildcard notation described on the pts createuser reference page. The user or machine entry must already exist in the Protection Database. -group <group name>+ Specifies the complete name (including the owner prefix if applicable) of each group to which to add members. The group entry must already exist in the Protection Database. -cell <cell name> Names the cell in which to run the command. For more details, see pts(1). -force Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the first error. -help Prints the online help for this command. All other valid options are ignored. -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or -noauth options. For more details, see pts(1). -noauth Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1). EXAMPLES
The following example adds user smith to the group system:administrators. % pts adduser -user smith -group system:administrators The following example adds users "jones", "terry", and pat to the smith:colleagues group. % pts adduser -user jones terry pat -group smith:colleagues The following example adds the machine entries in the ABC Corporation subnet to the group "bin-prot". Because of the IP address range of the ABC Corporation subnet, the system administrator was able to group the machines into three machine entries (using the wildcard notation discussed on the pts createuser reference page). % pts adduser -user 138.255.0.0 192.12.105.0 192.12.106.0 -group bin-prot PRIVILEGE REQUIRED
The required privilege depends on the setting of the fourth privacy flag in the Protection Database entry for each group named by the -group argument (use the pts examine command to display the flags): o If it is the hyphen, only the group's owner and members of the system:administrators group can add members. o If it is lowercase "a", current members of the group can add new members. o If it is uppercase "A", anyone who can access the cell's database server machines can add new members. SEE ALSO
pts(1), pts_createuser(1), pts_examine(1), pts_membership(1), pts_removeuser(1), pts_setfields(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2014-04-08 PTS_ADDUSER(1)
All times are GMT -4. The time now is 08:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy