Sponsored Content
Top Forums Shell Programming and Scripting Bash script - stripping away characters that can't be used in filenames Post 302322402 by vgersh99 on Wednesday 3rd of June 2009 03:36:14 PM
Old 06-03-2009
The only character that cannot be used in filename is '/' - act accordingly.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

stripping leftmost characters from string

Hi there, if i have some strings ie test_324423 test_242332 test_767667 but I only want the number part (the bolded bit) how do I strip the leftmost 5 characters from the output so that i will have just 324423 242332 767667 any help would be greatly appreciated Gary (5 Replies)
Discussion started by: hcclnoodles
5 Replies

2. UNIX for Dummies Questions & Answers

[bash]Stripping lines from a list

Hello! I have a script that is (among other things) doing the following: list=/tmp/list1.txt ncftpls -u <user> -p <password> -x "-l1" server.domain.tld > $list cat $list | nl echo "Choose file: " read file cat /tmp/list1.txt | nl | grep $file | sed -e "s/$file//g" -e "s/ //g" | column -t... (8 Replies)
Discussion started by: noratx
8 Replies

3. Shell Programming and Scripting

stripping certain characters in at the middle of a string

I am trying to strip out certain characters from a string on both (left & right) sides. For example, line=see@hear|touch, i only want to echo the "hear" part. Well i have tried this approach: line=see@hear|touch templine=${line#*@} #removed "see@" echo ${templine%%\|*} #removed... (4 Replies)
Discussion started by: mcoblefias
4 Replies

4. Shell Programming and Scripting

Filenames created with '\r' characters at the end

Hi all, Am creating files and doing copy,compare and deletion. As i do not want to mention the filepath everywhere, i store the filepaths in variables. FILENAME="/home/test/create/Myfile.txt" WR_PATH="/home/test/wrie/writefile.txt" RD_PATH="/home/test/myread/readfile.txt" echo "This is my... (2 Replies)
Discussion started by: amio
2 Replies

5. Shell Programming and Scripting

Whitespace in filenames in for loop in bash script

I'm trying to search all .odt files in a directory for a string in the text of the file. I've found a bash script that works, except that it can't handle whitespace in the filenames. #!/bin/bash if ; then echo "Usage: searchodt searchterm" exit 1 fi for file in $(ls *.odt); do ... (4 Replies)
Discussion started by: triplemaya
4 Replies

6. Shell Programming and Scripting

Stripping characters from a variable

I'm using a shell script to get user input with this command: read UserInput I would then like to take the "UserInput" variable and strip out all of the following characters, regardless of where they appear in the variable or how many occurrences there are: \/":|<>+=;,?*@ I'm not sure... (5 Replies)
Discussion started by: nrogers64
5 Replies

7. Shell Programming and Scripting

Stripping characters from a file and reformatting according to another one

Dear experts, my problem is pretty tricky. I want to change a file (see attached input.txt), according to another file (help.txt). The output that is desired is in output.txt. The example is attached. Note that -dashes should not be treated specially, they are considered normal characters,... (2 Replies)
Discussion started by: TheTransporter
2 Replies

8. UNIX for Dummies Questions & Answers

find & remove characters in filenames

I have a group of files in different directories with characters such as " ? : in the file names. How do I find these files and remove these characters on mass? Thanks (19 Replies)
Discussion started by: barrydocks
19 Replies

9. Shell Programming and Scripting

How best to remove certain characters from filenames and folders recursively

hello, I'm trying to figure out which tool is best for recursively renaming and files or folders using the characters \/*?”<>| in their name. I've tried many examples that use Bash, Python and Perl, but I'm not much of a programmer I seem to have hit a roadblock. Does anyone have any... (15 Replies)
Discussion started by: prometheon123
15 Replies

10. Shell Programming and Scripting

Stripping unwanted characters in field

I wrote myself a small little shell script to clean up a file I have issues with. In particular, I am stripping down a fully qualified host/domain name to just the hostname itself. The script works, but from a performance standpoint, it's not very fast and I will be working with large data sets. ... (4 Replies)
Discussion started by: dagamier
4 Replies
XkbSAPtrDfltValue(3)						   XKB FUNCTIONS					      XkbSAPtrDfltValue(3)

NAME
XkbSAPtrDfltValue - Returns the valueXXX field of act converted to a signed int SYNOPSIS
int XkbSAPtrDfltValue (XkbAction act); ARGUMENTS
- act action from which to extract group DESCRIPTION
Actions associated with the XkbPtrDfltAction structure change the mk_dflt_btn attribute of the MouseKeys control. If the MouseKeys control is not enabled, KeyPress and KeyRelease events are treated as though the action is XkbSA_NoAction. Otherwise, this action changes the mk_dflt_btn attribute of the MouseKeys control. The type field of the XkbPtrDfltAction structure should always be XkbSA_SetPtrDflt. The flags field is composed of the bitwise inclusive OR of the values shown in Table 1 (currently there is only one value defined). Table 1 Pointer Default Flags ----------------------------------------------------------------- Flag Meaning ----------------------------------------------------------------- XkbSA_DfltBtnAbsolute If set, the value field represents an absolute pointer button. Otherwise, the value field represents the amount to be added to the current default button. The affect field specifies what changes as a result of this action. The only valid value for the affect field is XkbSA_AffectDfltBtn. The valueXXX field is a signed character that represents the new button value for the mk_dflt_btn attribute of the MouseKeys control. If XkbSA_DfltBtnAbsolute is set in flags, valueXXX specifies the button to be used; otherwise, valueXXX specifies the amount to be added to the current default button. In either case, illegal button choices are wrapped back around into range. Xkb provides macros, to convert between the integer and signed character values in XkbPtrDfltAction structures. XkbSAPtrDfltValue returns the valueXXX field of act converted to a signed int. STRUCTURES
typedef struct _XkbPtrDfltAction { unsigned char type; /* XkbSA_SetPtrDflt */ unsigned char flags; /* controls the pointer button number */ unsigned char affect; /* XkbSA_AffectDfltBtn */ char valueXXX; /* new default button member */ } XkbPtrDfltAction; X Version 11 libX11 1.6.0 XkbSAPtrDfltValue(3)
All times are GMT -4. The time now is 01:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy