Sponsored Content
Top Forums Shell Programming and Scripting Decode %s Special Character in Sed Post 302395130 by wasabihowdi on Monday 15th of February 2010 05:19:29 AM
Old 02-15-2010
Thx so much agn! It worked super well!! Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed and special character in data

I have a script that is reading an existing report, pulling out the customer code, then tacking on the customer name from another file and replacing the existing customer code with the new field. This was written for me by someone else. I'm not real familiar with sed. The data is getting into... (3 Replies)
Discussion started by: MizzGail
3 Replies

2. Shell Programming and Scripting

Sed-Special character replacement

Hi I want to replace ./testsed.ksh with testsed.ksh ./ is to be removed scriptnm=`sed -e 's/\.///' $0 does not work Please help (3 Replies)
Discussion started by: usshell
3 Replies

3. Shell Programming and Scripting

Special Character SED/AWK removal

I have a script that produces an output containing '/.ssh'. I am trying to find a way of parsing only this data from a single line, without removing any other special characters contained within the output as a result of the parse. Any help would be appreciated (6 Replies)
Discussion started by: Raggedranger333
6 Replies

4. Shell Programming and Scripting

sed special character replace

I need to do the following: text in the format of: ADDRESS=abcd123:1111 - abcd123:1111 is different on every system. replace with: ADDRESS=localhost:2222 sed 's/ADDRESS=<What do I use here?>/ADDRESS=localhost:2222/g' Everything I've tried ends up with: ... (3 Replies)
Discussion started by: toor13
3 Replies

5. Shell Programming and Scripting

how to replace the special character with another using SED

I have the replace the pattern in the file , ); to ); Could someone please help me to get this command. (2 Replies)
Discussion started by: mohan.bit
2 Replies

6. Shell Programming and Scripting

How to substitute variable in sed for special character?

Hi , I have input file like below Hi this is "vinoth". Hi happy to work with 'unix' USA(united states of America) My script variables are below : Dquote=Ộ Squote=&#$567 Obrac=&^986 Cbrac=&^745 I want to read the variables in my SED command to replace the double quote,single... (9 Replies)
Discussion started by: vinothsekark
9 Replies

7. Shell Programming and Scripting

How to replace special character using sed?

How can I replace the follong text including to number 7000? cat tmp0.txt Winston (UK) Wong I would the 7000 to replace Winston (UK) Wong. I fail with method below: sed ' s /Winston\(UK\)Wong/7000 tmp0.txt' (1 Reply)
Discussion started by: vivien_chu
1 Replies

8. UNIX for Dummies Questions & Answers

Replacing special character with sed

Hi All, I have a text file that contains I1SP2 *=*=Y=M=D001D My requirement is to replace all occurrence of =* to =Z expected o/p is I1SP2 *=Z=Y=M=D001D I have tried with sed 's/=*/=Z/g' file sed 's!\=*!\=Z/g' file sed 's!\=*!\=Z!g' file sed 's!\=\*!\=Z!g' file but its not... (3 Replies)
Discussion started by: gotamp
3 Replies

9. Shell Programming and Scripting

sed add special character

Hi all I got test.test.test and need test.test\.test * I need the backslash before the last dot in the line I tried echo test.test.test | sed 's/\./\\./g' but it gives me test\.test\.test Thanks (7 Replies)
Discussion started by: stinkefisch
7 Replies

10. UNIX for Beginners Questions & Answers

With sed replaced special character is printed twice, why?

Dear all, I was wondering If you could help me out. I Am using a batch script to midfy some text files. Input: 912856 912857 912904Amongst others I use this line: REM I want to replace all lines that start with a 6-digit Number with a ftp command "get" followed by a path and the 6-digit... (9 Replies)
Discussion started by: SIEMI
9 Replies
CHFLAGS(2)						      BSD System Calls Manual							CHFLAGS(2)

NAME
chflags, lchflags, fchflags -- set file flags LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <sys/stat.h> #include <unistd.h> int chflags(const char *path, u_long flags); int lchflags(const char *path, u_long flags); int fchflags(int fd, u_long flags); DESCRIPTION
The file whose name is given by path or referenced by the descriptor fd has its flags changed to flags. For lchflags(), symbolic links are not traversed and thus their modes may be changed with this call. The flags specified are formed by or'ing the following values: UF_NODUMP Do not dump the file. UF_IMMUTABLE The file may not be changed. UF_APPEND The file may only be appended to. UF_OPAQUE The file (if a directory) is opaque for union mounts. SF_ARCHIVED The file is archived. SF_IMMUTABLE The file may not be changed. SF_APPEND The file may only be appended to. The UF_NODUMP, UF_IMMUTABLE, UF_APPEND, and UF_OPAQUE flags may be set or unset by either the owner of a file or the super-user, except on block and character devices, where only the super-user may set or unset them. The SF_ARCHIVED, SF_IMMUTABLE, and SF_APPEND flags may only be set or unset by the super-user. Attempts by the non-super-user to set the super-user only flags are silently ignored. These flags may be set at any time, but normally may only be unset when the system is in single- user mode. (See init(8) for details.) RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, -1 is returned and the global variable errno is set to indicate the error. ERRORS
chflags() will fail if: [ENOTDIR] A component of the path prefix is not a directory. [ENAMETOOLONG] A component of a pathname exceeded {NAME_MAX} characters, or an entire path name exceeded {PATH_MAX} characters. [ENOENT] The named file does not exist. [EACCES] Search permission is denied for a component of the path prefix. [ELOOP] Too many symbolic links were encountered in translating the pathname. [EPERM] The effective user ID does not match the owner of the file and the effective user ID is not the super-user, or the effec- tive user ID is not the super-user and one or more of the super-user-only flags for the named file would be changed. [EOPNOTSUPP] The named file resides on a file system that does not support file flags. [EROFS] The named file resides on a read-only file system. [EFAULT] path points outside the process's allocated address space. [EIO] An I/O error occurred while reading from or writing to the file system. fchflags() will fail if: [EBADF] The descriptor is not valid. [EINVAL] fd refers to a socket, not to a file. [EPERM] The effective user ID does not match the owner of the file and the effective user ID is not the super-user, or the effec- tive user ID is not the super-user and one or more of the super-user-only flags for the file would be changed. [EOPNOTSUPP] The file resides on a file system that does not support file flags. [EROFS] The file resides on a read-only file system. [EIO] An I/O error occurred while reading from or writing to the file system. SEE ALSO
chflags(1), stat(2), stat_flags(3), init(8), mount_union(8) HISTORY
The chflags() and fchflags() functions first appeared in 4.4BSD. The lchflags() function first appeared in NetBSD 1.5. BSD
August 6, 2011 BSD
All times are GMT -4. The time now is 09:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy