Sponsored Content
Top Forums UNIX for Advanced & Expert Users getting error while copying files Post 302241284 by nua7 on Monday 29th of September 2008 03:37:20 AM
Old 09-29-2008
Following are the solutions for this :

Code:
sed 's/^M//g' ${INPUT_FILE} > tmp.txt
mv  tmp.txt  ${INPUT_FILE}


tr -d "\15"  < ${INPUT_FILE} >  tmp.txt;
mv  tmp.txt  ${INPUT_FILE}


for file in $(find /path/to/dir -type f); do
   tr -d '\r' <$file >temp.$$ && mv temp.$$ $file
done

Feel free to choose your option.If it's a DOS file, check out the command dos2unix.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Copying files

I like to know the command structure of copying files/directories from a unix box using telnet session to a windows box. (4 Replies)
Discussion started by: alpheusm
4 Replies

2. Solaris

Copying Files and

I am new user to solaris and installed solaris operating system on full Harddisk 120Gb. I am unable to copy music files to desktop and /home directory. One thing happened while registering is- i entered login-root and its password. The message prompted your system is crashed. Is it because of... (1 Reply)
Discussion started by: patilmukundraj
1 Replies

3. Shell Programming and Scripting

copying files

hi I want to copy all files from the current directory and move to .archive file. Moreover,I want to add .bak to each file name, that will be copied. How can I do that? (4 Replies)
Discussion started by: tjay83
4 Replies

4. UNIX for Dummies Questions & Answers

Shell Syntax Error when copying files

Hello, I apologize if this was addressed in a previous post. I have done some searching but may have missed it. I am trying to read a list from a file, for example: 3bik 3bix 3biu 3bin 1nwn and using this list, copy files with these names (ex: 3bik.dssp.Z) to a seperate folder,... (1 Reply)
Discussion started by: InfoSeeker
1 Replies

5. UNIX for Advanced & Expert Users

copying of files by userB, dir & files owned by userA

I am userB and have a dir /temp1 This dir is owned by me. How do I recursively copy files from another users's dir userA? I need to preserve the original user who created files, original group information, original create date, mod date etc. I tried cp -pr /home/userA/* . ... (2 Replies)
Discussion started by: Hangman2
2 Replies

6. UNIX for Dummies Questions & Answers

No such file or directory error while copying files

Hi, I need to copy files from one dir to another dir. The list of filesnames to be moved are in a file called files2cp.log Script: #!/bin/ksh exec 0</home/amdocs/files2cp.log while read LINE do cp -i /iccs33/attach/"$LINE" /iccs30/attach/"$LINE" done The output is "No such... (6 Replies)
Discussion started by: srinirsr
6 Replies

7. Shell Programming and Scripting

Error copying files from Unix (Solaris10) to Windows Server 2003 using scp/sftp

Hi, I have generated a Public/Private Key Pair in Solaris Unix (source) server and deployed the Public key in Windows 2003(target) server .ssh directory of user profile. When i try to connect(ssh, scp, sftp) from Unix, i'm getting below error message. Sun_SSH_1.1, SSH protocols 1.5/2.0,... (0 Replies)
Discussion started by: ajaykumarb
0 Replies

8. Shell Programming and Scripting

Files copying - [ Listed files alone. ] - Shell script

Hi All, I am doing this for svn patch making. I got the list of files to make the patch. I have the list in a file with path of all the files. To Do From Directory : /myproject/MainDir To Directory : /myproject/data List of files need to copy is in the file: /myproject/filesList.txt ... (4 Replies)
Discussion started by: linuxadmin
4 Replies

9. Solaris

Error copying files

I have installed Solaris 10 on a Sunblade 150 (512 MB RAM) successfully. But when I create a new directory and try to copy a 40 MB file to it it stops after about 37 MB and gives an error "I/O error" while copying. I have 40GB of Hard Disk. What is the problem? (8 Replies)
Discussion started by: mickod
8 Replies

10. Shell Programming and Scripting

Copying files

All, I need to grab and rename common files from several unique directory structures. For example, the directory structures looks like: /unique_dir/common/common/common/person_name_dir/common_file.txt There are over 90,000 of these text files that I'd like to put in a single directory as... (5 Replies)
Discussion started by: hburnswell
5 Replies
di_lnode_name(3DEVINFO) 			       Device Information Library Functions				   di_lnode_name(3DEVINFO)

NAME
di_lnode_name, di_lnode_devinfo, di_lnode_devt - return libdevinfo lnode information SYNOPSIS
cc [ flag... ] file... -ldevinfo [ library... ] #include <libdevinfo.h> char *di_lnode_name(di_lnode_t lnode); di_node_t di_lnode_devinfo(di_lnode_t lnode); int di_lnode_devt(di_lnode_t lnode, dev_t *devt); PARAMETERS
lnode A handle to an lnode. devt A pointer to a dev_t that can be returned. DESCRIPTION
These functions return libdevinfo lnode information. The di_lnode_name() function returns a pointer to the name associated with lnode. The di_lnode_devinfo() function returns a handle to the device node associated with lnode. The di_lnode_devt() function sets the dev_t pointed to by the devt parameter to the dev_t associated with lnode. RETURN VALUES
The di_lnode_name() function returns a pointer to the name associated with lnode. The di_lnode_devinfo() function returns a handle to the device node associated with lnode. The di_lnode_devt() function returns 0 if the requested attribute exists in lnode and was returned. It returns -1 if the requested attribute does not exist and sets errno to indicate the error. ERRORS
The di_lnode_devt() function will fail if: EINVAL An argument was invalid. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
di_init(3DEVINFO), libdevinfo(3LIB), attributes(5) SunOS 5.10 22 Mar 2004 di_lnode_name(3DEVINFO)
All times are GMT -4. The time now is 07:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy