Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Problem deleting file with special character Post 92041 by vino on Wednesday 7th of December 2005 10:18:31 AM
Old 12-07-2005
From man sh

Code:
       --        A -- signals the end of options and disables  further  option
                 processing.   Any arguments after the -- are treated as file-
                 names and arguments.  An argument of - is equivalent to --.

Look at this

Code:
sh-2.05b$ touch -- -123
sh-2.05b$ ls -l -- -123
-rw-r--r--    1 abcdefgh g900            0 Dec  7 07:17 -123
sh-2.05b$ rm  -- -123
sh-2.05b$ ls -l -- -123
ls: -123: No such file or directory
sh-2.05b$

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

delete a special character in file

hi i want to delete a particular character in file. example file name:abcsample abc=bbbqw3/ hidh=ajjqiwio4/ xyx=hakjp/ ........../ ......./ i want to delete that special character (/) in abcsample file.please give the required commands for my requirement. thank you (3 Replies)
Discussion started by: srivsn
3 Replies

2. Shell Programming and Scripting

delete a special character in file

hi i want to delete a particular character in file. example file name:abcsample abc=bbbqw3/ hidh=ajjqiwio4/ xyx=hakjp/ ........../ ......./ i want to delete that special character (/) in abcsample file Permnently.please give the required commands for my requirement. required... (1 Reply)
Discussion started by: srivsn
1 Replies

3. UNIX for Dummies Questions & Answers

Special character in my file

I have a special character in my file. It displays as a '#' sign but when I do this command I do not find the line. fgrep 'G#ant' file1 I want to replace the special character with another value but I need to know what character it really is. Any ideas on how to replace this '#' value with... (3 Replies)
Discussion started by: Ryan2786
3 Replies

4. Shell Programming and Scripting

deleting a special file

Hi, I have FTP'd a file two times from windows to unix machine. The second file is coming as bbmenu (2). I want to delete this file but it is not getting deleted. Kindly let me know the way how i can do that. Thanks Namish (2 Replies)
Discussion started by: namishtiwari
2 Replies

5. Shell Programming and Scripting

parse a file for a special character

hello, How to parse a file to see if a specific line is commented by '#' character? filename: file1 cat file1 ... # /usr/bin/whatever ... thank you (9 Replies)
Discussion started by: melanie_pfefer
9 Replies

6. Shell Programming and Scripting

Deleting all characters from 350th character to 450th character from the log file

Hi All, I have a big log file i want to delete all characters (between 350th to 450th characters) starting at 350th character position to 450th character position. please advice or sample code. (6 Replies)
Discussion started by: rajeshorpu
6 Replies

7. Shell Programming and Scripting

Removing Special Character from File.

Hi, My file has this special character "^M" I would like to remove this characters. eg: abc,abc,^M i tried using sed but doesnt work. i used octal dump command to see special character it returns following: 015 \r Appreciate your reply. (6 Replies)
Discussion started by: pinnacle
6 Replies

8. Programming

Problem with control file and special character

I am getting error when loading data file using ctl file. I get this error only when there is special character. Below is some data. DataFile=> company_id|ciu_id|english_name|iso_country_code|active|partner_name 1-2JT-122||Expert Järvenpää|FI|A|Expert Järvenpää Control File=> LOAD DATA... (1 Reply)
Discussion started by: rshivarkar
1 Replies

9. Red Hat

Special character ^@ in CSV file

All, I am having a tough time with Linux and CSV file. My CSV file gets generated from Cognos on Linux machine that contains special characters. At first instance when I do vi <filename> to that file, I can't see anything. I did tail -2 and redirected to another temp file and did vi <filename>,... (2 Replies)
Discussion started by: donadarsh
2 Replies
sdp_delete_media(3COMMPUTIL)		     Communication Protocol Parser Utilities Library Functions		      sdp_delete_media(3COMMPUTIL)

NAME
sdp_delete_media, sdp_delete_attribute - delete the specified media or attribute from the appropriate list SYNOPSIS
cc [ flag...] file... -lcommputil [ library...] #include <sdp.h> int sdp_delete_media(sdp_media_t **l_media, sdp_media_t *media); int sdp_delete_attribute(sdp_attr_t **l_attr, sdp_attr_t *attr); DESCRIPTION
The sdp_delete_media() function deletes the specified media from the media list. It is similar to deleting a node in a linked list. The function first finds the media that needs to be deleted using sdp_find_media(3COMMPUTIL). The found media is then passed to sdp_delete_media() to delete it. The function frees the memory allocated to media structure after deleting it. The sdp_delete_attribute() function deletes the specified attribute from the attribute list. It is similar to deleting a node in a linked list. The function first finds the attribute that needs to be deleted using sdp_find_media_rtpmap(3COMMPUTIL) or sdp_find_attribute(3COMM- PUTIL). The found attribute is then passed to sdp_delete_attribute() to delete it. The function frees the memory allocated to attribute structure after deleting it. RETURN VALUES
Upon successful completion, these functions return 0. Otherwise, the appropriate error value is returned. The value of errno is not changed by these calls in the event of an error. ERRORS
These functions will fail if: EINVAL The mandatory input parameters are not provided or are NULL. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ |MT-Level |Safe | +-----------------------------+-----------------------------+ SEE ALSO
libcommputil(3LIB), sdp_find_attribute(3COMMPUTIL), sdp_find_media(3COMMPUTIL), sdp_find_media_rtpmap(3COMMPUTIL), attributes(5) SunOS 5.11 12 Oct 2007 sdp_delete_media(3COMMPUTIL)
All times are GMT -4. The time now is 03:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy