Sponsored Content
Full Discussion: remove dash
Top Forums Shell Programming and Scripting remove dash Post 302280134 by zaxxon on Monday 26th of January 2009 05:05:58 AM
Old 01-26-2009
Code:
echo 'ABC-DEF'| tr -d '-'
ABCDEF

 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to remove a file with a leading dash '-' in it's name?

Somehow someone created a file named '-ov' in the root directory. Given the name, the how was probably the result of some cpio command they bozo'ed. I've tried a number of different ways to get rid of it using * and ? wildcards, '\' escape patterns etc.. They all fail with " illegal option --... (3 Replies)
Discussion started by: GSalisbury
3 Replies

2. Shell Programming and Scripting

double-dash options

I need to create a file that accepts arguments and options, and the options have to allow for single-dash options (-abc) and double-dash options (--help). What is the best way to do this? Getopt(s) is great for single-dash, but chokes on double-dash. Do I really need to save the arguments to a... (1 Reply)
Discussion started by: dhinge
1 Replies

3. UNIX for Dummies Questions & Answers

dash after ampersant

Hi! I'm new in these forums and more or less new with Unix. So... here is the question: does anyone know where is redirected the output of a command when you put >&- after it? Does it means any standard file descriptor? Thanks! (2 Replies)
Discussion started by: csecnarf
2 Replies

4. UNIX for Dummies Questions & Answers

ignoring a dash in file name

so i have a simple file called -x and i need it renamed to x now i dont understand why when using the most basic methods, only the code mv ./-x x changes the file name while using any other type of escape characters around the dash, such as single/double quotations or backslash, doesnt. ... (5 Replies)
Discussion started by: LumpSum
5 Replies

5. Shell Programming and Scripting

How to concatenate string containing a leading dash?

Is there a way to concatenate two strings, where the first string is "-n" and there is a space between the "-n" and the second string? Below are some examples of what I tried. #!/bin/sh var1=test #working without dashes: var2="n $var1" echo $var2 var2=n" "$var1 echo $var2 var2="n... (5 Replies)
Discussion started by: wolfv
5 Replies

6. UNIX for Advanced & Expert Users

Exclude dash (-) from word separators in vi

vi uses dash and space as word separators. is there any way to exclude dash from word separators ? This is required to work with the symbols generated by ctags exe. when symbol contain a "-" ,vi tags fails to locate that even though symbol is generated properly. For example Symbol -... (3 Replies)
Discussion started by: cabhi
3 Replies

7. Shell Programming and Scripting

Exclude dash in grep

Hi, I must be overlooking something, but I don't understand why this doesn't work. I'm trying to grep on a date, excluding all the lines starting with a dash: testfile: #2013-12-31 2013-12-31code: grep '^2013-12-31' testfileI'm expecting to see just the second line '2013-12-31' but I don't... (3 Replies)
Discussion started by: Subbeh
3 Replies

8. OS X (Apple)

'time' does NOT work on a function in 'dash'.

Hi guys and gals... I am writing a piece of code that is dash compliant and came across this error. I have put it in the OSX section as that is what I am using. I have no idea what the 'dash' version is but was installed about 6 months ago. MBP, OSX 10.12.6, default terminal running dash on... (4 Replies)
Discussion started by: wisecracker
4 Replies

9. Shell Programming and Scripting

A dash to GOTO or a dash from GOTO, that is the question...

Well, guys I saw a question about GOTO for Python. So this gave me the inspiration to attempt a GOTO function for 'dash', (bash and ksh too). Machine: MBP OSX 10.14.3, default bash terminal, calling '#!/usr/local/bin/dash'... This is purely a fun project to see if it is possible in PURE... (3 Replies)
Discussion started by: wisecracker
3 Replies
SETFATTR(1)                                                       File Utilities                                                       SETFATTR(1)

NAME
setfattr - set extended attributes of filesystem objects SYNOPSIS
setfattr [-h] -n name [-v value] pathname... setfattr [-h] -x name pathname... setfattr [-h] --restore=file DESCRIPTION
The setfattr command associates a new value with an extended attribute name for each specified file. OPTIONS -n name, --name=name Specifies the name of the extended attribute to set. -v value, --value=value Specifies the new value for the extended attribute. -x name, --remove=name Remove the named extended attribute entirely. -h, --no-dereference Do not follow symlinks. If pathname is a symbolic link, it is not followed, but is instead itself the inode being modified. --restore=file Restores extended attributes from file. The file must be in the format generated by the getfattr command with the --dump option. If a dash (-) is given as the file name, setfattr reads from standard input. --version Print the version of setfattr and exit. --help Print help explaining the command line options. -- End of command line options. All remaining parameters are interpreted as file names, even if they start with a dash character. AUTHOR
Andreas Gruenbacher, <a.gruenbacher@bestbits.at> and the SGI XFS development team, <linux-xfs@oss.sgi.com>. Please send your bug reports or comments to these addresses. SEE ALSO
getfattr(1), and attr(5). Dec 2001 Extended Attributes SETFATTR(1)
All times are GMT -4. The time now is 04:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy