Here is a dead-sure way of erasing even the most nastily named file:
get the inode number by using "ls -lai":
Now use the inode for a "find"-command:
Instead of "rm" use whatever command you want to apply to the file. This will even work on files named "..." (yes, this is legal - if you want to torture your sysadmin) or something like that.
But in your case it might be even simpler than that: if the "\r" in the filenames are real character and not the visualization of some nasty control chars (find out by piping "ls -la" to a file and use "set list" in vi to display control codes) then simply escaping the backslash should suffice: "filename\\r" for what is displayed as "filename\r", etc.
I have a problem with the script below
#!/bin/sh
for vo in `find -maxdepth 1 -type f -regex "^\./*$"`
do
ls -l "$vo"
some other commands
done
It works fine until `find ...` returns files with spaces. I've tryed to change IFS but haven't succeed
Any solutions? (4 Replies)
Hi folks,
there are windows device names in the sixth column of a comma separated file. A example device name is:
\\.\Tape0
I don't get the all string in to a variable, because of the preceding backslash. The first backslash is just cut off and my attempts to manipulate the string afterward... (0 Replies)
Hi,
Newbie here. I have a file that consists of data that I want to convert to a csv file. For example:
Jul 20 2008 1111 / visit home / BlackBerry8830/4.2.2 Profile/MIDP-2.0 Configuration/CLOC-1.1 VendorID/105
Jul 21 2008 22222 / add friend / BlackBerry8830/4.2.2 Profile/MIDP-2.0... (3 Replies)
Hi,
I have a requirement where i need to replace 3 backslashes with 2 in the below mentioned string, but i am facing problem with backslashes. However i tried the option below but doesnt work. My input remains a constant as i receive it from my upstream.
Input String= "-rfile... (3 Replies)
Hi there,
i am struggling with this one, basically i want to replace an existing path string in a file with a new one, but the new one contains slashes which causes problems with "sed", i thought i could change the replacement string into a variable but of course when the variable is evaluated... (4 Replies)
i excuted filemon with filemon -u -o /tmp/filemon.out -O all;sleep 60; trcstop.
everything is ok, but i only get PID for filenames in Most Active Files.
is there any different flags i need to use to get filenames?
Code tags please, thanks. (3 Replies)
I'd like to write up notes in a relatively readable format and then use a shell script to add LaTeX formatting. Specifically, I'm trying to figure out how to add the LaTeX newline character (\\) to the end of lines without \begin{} or \end{} statements
example notes file:
\begin{enumerate}
--... (2 Replies)
Hi,
Its been a long time since I've done any shell scripting and I need some help here. Thanks in advance...
I need this as a bourne or csh script running under SCO.
In a folder I have a list of Backup files named with "TarBackup plus a date and time component suffix" like this;
... (2 Replies)
Discussion started by: stanlyn
2 Replies
LEARN ABOUT POSIX
pts_removeuser
PTS_REMOVEUSER(1) AFS Command Reference PTS_REMOVEUSER(1)NAME
pts_removeuser - Removes a user from a Protection Database group
SYNOPSIS
pts removeuser -user <user name>+ -group <group name>+
[-cell <cell name>] [-noauth] [-localauth] [-force]
[-help]
pts rem -u <user name>+ -g <group name>+
[-c <cell name>] [-n] [-l] [-f] [-h]
DESCRIPTION
The pts removeuser command removes each user or machine named by the -user argument from each group named by the -group argument.
To add users to a group, use the pts adduser command. To list group membership, use the pts membership command. To remove users from a
group and delete the group's entry completely in a single step, use the pts delete command.
CAUTIONS
AFS compiles each user's group membership as he or she authenticates. Any users who have valid tokens when they are removed from a group
retain the privileges extended to that group's members until they discard their tokens or reauthenticate.
OPTIONS -name <user name>+
Specifies the name of each user entry or the IP address (complete or wildcard-style) of each machine entry to remove.
-group <group name>+
Names each group from which to remove members.
-cell <cell name>
Names the cell in which to run the command. For more details, see pts(1).
-force
Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the
first error.
-help
Prints the online help for this command. All other valid options are ignored.
-localauth
Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or
-noauth options. For more details, see pts(1).
-noauth
Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1).
EXAMPLES
The following example removes user smith from the groups "staff" and "staff:finance". Note that no switch names are necessary because only
a single instance is provided for the first argument (the username).
% pts removeuser smith staff staff:finance
The following example removes three machine entries, which represent all machines in the ABC Corporation network, from the group
"bin-prot":
% pts removeuser -user 138.255.0.0 192.12.105.0 192.12.106.0 -group bin-prot
PRIVILEGE REQUIRED
The required privilege depends on the setting of the fifth privacy flag in the Protection Database for the group named by the -group
argument (use the pts examine command to display the flags):
o If it is the hyphen, only the group's owner and members of the system:administrators group can remove members.
o If it is lowercase "r", members of the group can also remove other members.
(It is not possible to set the fifth flag to uppercase "R".)
SEE ALSO pts(1), pts_adduser(1), pts_examine(1), pts_membership(1), pts_setfields(1)COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas
Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.
OpenAFS 2014-04-08 PTS_REMOVEUSER(1)