When running the following sed command from the command line I am able to
remove all entries with #username from the file and redirect to another file.
When I use the same command in the following script I end up with the original
entries in the namesonly file. ie nothing has been removed.
Is there an error with this command or something else causing the problem?
How do we delete all carriage returns after a particular string using sed inside a K Shell?
e.g. I have a text file named file1 below:
$ more file1
Group#=1 User=A
Role=a1
Group#=2 User=B
Role=a1
Role=b1
Group#=3 User=C
Role=b1
I want the carriage returns to be delete on the... (12 Replies)
HI All,
Have some files which contains some string like,
"create .<table1> as"
"insert into .<table2> values",
i want to replace ".<table1>" with only "<table1>", i.e removing '.' character in ksh, i have written below code but it is not removing the dot character, any help?
for name... (2 Replies)
Hi,
I have a file with the text below. How do i remove the character "%" from the text file using sed ? Can anybody help ?
0%
68%
72%
0%
54%
33%
75%
24%
6%
59%
77%
77%
33% (6 Replies)
Hello,
I have a file Test.txt with 9 columns that looks like this:
1g12 A 14 19 2OAY A 326 331 AAAASA
1l7v A 68 73 1l7v A 68 73 AALAIS
1l7v A 68 73 1XVW B 72 77 AALAIS
1l7v A 68 73 1XXU A 65 70 AALAIS
1l7v A 68 73 1XXU B 65 70 AALAIS
1l7v A 68 73 1XXU C 65 70 AALAIS
1l7v A 68 73 1XXU D... (4 Replies)
I have a source text file that contains something like this:
<start_template>
bool function( void *<var_name> )
{
// Blah Blah
}
</start_template>
Following is used to remove this template from source file.
template=$(sed -n -e '/<start_template>/,/<\/start_template>/{... (4 Replies)
Is there an easy way in sed to remove a character and values
after that character?
ex:
blackout_10-11-2011(NODE_LEVEL)
I want to remove '(' and everything after. so I will only have.
blackout_10-11-2011
I can use a cut command to do this but interested in seeing how its done... (1 Reply)
I am trying to use the sed command to remove any character that is passed as a parameter to the script. I may want to replace any character in the file (-, =, $, space). I'm running into an issue when passing the $.
This is a typical row in the file.
"000000B553","--INTERNAL USE... (6 Replies)
I have a file and I want to remove quotes from the word " ` " through sed command but unable to remove
I am using below command
sed s/"`XYZ`"/"ZXY"/g file1.txt > file2.txt
But this is not working. How can we remove "`" through sed command (2 Replies)
I would like produce
blue, green, red, yellowfrom"blue:,*green:,*red:,*yellowI can remove the colon with
echo "blue:,*green:,*red:,*yellow" | sed 's/://g'which givesblue,*green,*red,*yellowbut when I try
echo "blue:,*green:,*red:,*yellow" | sed 's/://g'; 's/*//g'I get bash: s/*//g: No such... (9 Replies)
Discussion started by: Xubuntu56
9 Replies
LEARN ABOUT NETBSD
lastlogin
LASTLOGIN(8) BSD System Manager's Manual LASTLOGIN(8)NAME
lastlogin -- indicate last login time of users
SYNOPSIS
lastlogin [-nrt] [-f filename] [-H hostsize] [-L linesize] [-N namesize] [user ...]
DESCRIPTION
lastlogin will list the last login session of specified users, or for all users by default. Each line of output contains the user name, the
tty from which the session was conducted, any hostname, and the start time for the session.
If multiple users are given, the session information for each user is printed in the order given on the command line. Otherwise, information
for all users is printed, sorted by uid.
lastlogin differs from last(1) in that it only prints information regarding the very last login session. The last login database is never
turned over or deleted in standard usage.
The following options are available:
-f filename
Process input from filename. If the file ends with an ``x'', then it is assumed that it is a lastlogx(5) file, else it is assumed to
be a lastlog(5) file.
-H hostlen
Set the field width for host output to hostlen characters.
-L linelen
Set the field width for line output to linelen characters.
-N namelen
Set the field width for name output to namelen characters.
-n Attempt to print numeric host addresses. This option is only supported with lastlogx(5) format files.
-r Reverse the order of the sort.
-t Sort by last login time (most recent first.)
FILES
/var/log/lastlogx default last login database
/var/log/lastlog compatibility last login database
EXAMPLES
lastlogin looks by default to the /var/log/lastlogx database, where some old programs that are not utmpx(5) aware might only write to
/var/log/lastlog. To look at the old database one can use:
lastlogin -f /var/log/lastlog
SEE ALSO last(1), lastlog(5), lastlogx(5), ac(8)AUTHORS
John M. Vinopal wrote this program in January 1996 and contributed it to the NetBSD project.
BSD March 4, 2005 BSD