07-03-2007
Trying to remove single character from a line
Here is a sample code
grep '903' -i user.txt | tail -2 | awk '{print $2}' | sed 's/B//g'
the input file has data as such
903-xxx-xxxxB
903-xxx-xxxxB
It is a dialer file i want to remove the "B"
any help thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to put the single line contents of a file into a variable, but remove the last character, for example the file would have this sort of contents:
2;4;3;10;67;54;96;
And I want the variable to be:
2;4;3;10;67;54;96 (notice the last ";" has gone).
Unfortunately I can't just... (4 Replies)
Discussion started by: danhodges99
4 Replies
2. Programming
Does anyone knows how to write a program to remove single-line comment in C program?
that means it don't read anything behind // (3 Replies)
Discussion started by: Icy002
3 Replies
3. Shell Programming and Scripting
I've been looking on the internet, and haven't found anything simple enough to use in my code. All I want to do is count how many times "-" occurs in a string of characters (as a package name). It seems it should be very simple, and shouldn't require more than one line to accomplish.
And this is... (2 Replies)
Discussion started by: Shingoshi
2 Replies
4. HP-UX
Hi Experts,
I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line.
File is comma (,) seperated.
Eg:
ID,Client ,SNo,Rank
37,Airtel \n... (8 Replies)
Discussion started by: sasikari
8 Replies
5. Shell Programming and Scripting
Hi,
I should read one character at a fixed position from each line of the file. So how ??? should be substituted in the code below:
while read line ; do
single_char=`???`
echo "$single_char"
done < $input_file (8 Replies)
Discussion started by: arsii
8 Replies
6. Shell Programming and Scripting
Hi,
I have a file with lines such as the below. I want to remove the comma only if it is the first character on a line. I can't work out how to do this using sed.
*ELSET, ELSET=WHEEL_TD2
63, 64, 65, 72, 82, 88, 89, 92, 120, 121, 152, 181, 190, 221, 252, 259
, 260, 282, 283, 285, 286,... (2 Replies)
Discussion started by: carlr
2 Replies
7. UNIX for Dummies Questions & Answers
Hi guys,
Does anyone know how to remove the last character in each of the line?
This is what I have:
ABCDE.1
GLSJD.2
HIJPL.2
HKAGB.3
IUBWQ.1
What I want (remove the dot and number):
ABCDE
GLSJD
HIJPL
HKAGB
IUBWQ
I tried to use this: sed 's/.*//'
But I'm not sure if that is... (3 Replies)
Discussion started by: narachaid
3 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am trying to remove multi line and single line comments like examples below
I have tried this pattern. it works fine for single line comments and multi line comments in a single line only. but this fails when the comments are extended in multiple lines as shown in the comment 2 of... (3 Replies)
Discussion started by: ahmedwaseem2000
3 Replies
9. Shell Programming and Scripting
Regarding copy/pasted text of copyright-free book from archive.org (link below), in attempt to expand single-line-break paragraph text (not section headings or paragraph breaks) to wider right margin, Justify or Wrap in LIbreOffice is not working, and Find/Replace the paragraph mark ($) wraps all... (2 Replies)
Discussion started by: p1ne
2 Replies
10. Shell Programming and Scripting
Hi All,
So I have to remove all the @hostnames from a file, the problem is, there are instances where @ is used for other things... For example:
example text:
@This is some text in between some at signs@
@This is some more text@
This is a line that will contain a username and his/her... (5 Replies)
Discussion started by: joeg1484
5 Replies
LEARN ABOUT DEBIAN
pure-authd
pure-authd(8) Pure-FTPd pure-authd(8)
NAME
pure-authd - External authentication agent for Pure-FTPd.
SYNTAX
pure-authd [-p </path/to/pidfile>] [-u uid] [-g gid] [-B] <-s /path/to/socket> -r /program/to/run
DESCRIPTION
pure-authd is a daemon that forks an authentication program, waits for an authentication reply, and feed them to an application server.
pure-authd listens to a local Unix socket. A new connection to that socket should feed pure-authd the following structure :
account:xxx
password:xxx
localhost:xxx
localport:xxx
peer:xxx
end
(replace xxx with appropriate values) . localhost, localport and peer are numeric IP addresses and ports. peer is the IP address of the
remote client.
These arguments are passed to the authentication program, as environment variables :
AUTHD_ACCOUNT
AUTHD_PASSWORD
AUTHD_LOCAL_IP
AUTHD_LOCAL_PORT
AUTHD_REMOTE_IP
AUTHD_ENCRYPTED
The authentication program should take appropriate actions to fetch account info according to these arguments, and reply to the standard
output a structure like the following one :
auth_ok:1
uid:42
gid:21
dir:/home/j
end
auth_ok:xxx
If xxx is 0, the user was not found (the next authentication method passed to pure-ftpd will be tried) . If xxx is -1, the user was
found, but there was a fatal authentication error : user is root, password is wrong, account has expired, etc (next authentication
methods will not be tried) . If xxx is 1, the user was found and successfully authenticated.
uid:xxx
The system uid to be assigned to that user. Must be > 0.
gid:xxx
The primary system gid. Must be > 0.
dir:xxx
The absolute path to the home directory. Can contain /./ for a chroot jail.
slow_tilde_expansion:xxx (optional, default is 1)
When the command 'cd ~user' is issued, it's handy to go to that user's home directory, as expected in a shell environment. But
fetching account info can be an expensive operation for non-system accounts. If xxx is 0, 'cd ~user' will expand to the system user
home directory. If xxx is 1, 'cd ~user' won't expand. You should use 1 in most cases with external authentication, when your FTP
users don't match system users. You can also set xxx to 1 if you're using slow nss_* system authentication modules.
throttling_bandwidth_ul:xxx (optional)
The allocated bandwidth for uploads, in bytes per second.
throttling_bandwidth_dl:xxx (optional)
The allocated bandwidth for downloads, in bytes per second.
user_quota_size:xxx (optional)
The maximal total size for this account, in bytes.
user_quota_files:xxx (optional)
The maximal number of files for this account.
ratio_upload:xxx (optional)
radio_download:xxx (optional)
The user must match a ratio_upload:ratio_download ratio.
Only one authentication program is forked at a time. It must return quickly.
OPTIONS
-u <uid>
Have the daemon run with that uid.
-g <gid>
Have the daemon run with that gid.
-B Fork in background (daemonization).
-s </path/to/socket>
Set the full path to the local Unix socket.
-R </path/to/program>
Set the full path to the authentication program.
-h Output help information and exit.
EXAMPLES
To run this program the standard way type:
pure-authd -s /var/run/ftpd.sock -r /usr/bin/my-auth-program &
pure-ftpd -lextauth:/var/run/ftpd.sock &
/usr/bin/my-auth-program can be as simple as :
#! /bin/sh
echo 'auth_ok:1'
echo 'uid:42'
echo 'gid:21'
echo 'dir:/home/j'
echo 'end'
AUTHORS
Frank DENIS <j at pureftpd dot org>
SEE ALSO
ftp(1), pure-ftpd(8) pure-ftpwho(8) pure-mrtginfo(8) pure-uploadscript(8) pure-statsdecode(8) pure-pw(8) pure-quotacheck(8) pure-authd(8)
RFC 959, RFC 2389, RFC 2228 and RFC 2428.
Pure-FTPd team 1.0.36 pure-authd(8)