Sponsored Content
Homework and Emergencies Homework & Coursework Questions Display sorted list using sed command Post 302788747 by kofine05 on Tuesday 2nd of April 2013 12:41:00 PM
Old 04-02-2013
Display sorted list using sed command

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data:
Write a command line that will display a sorted list of logged in users. Just display the username and no other information. To accomplish this task you must use the sed command (The cut command is not allowed).


2. Relevant commands, code, scripts, algorithms:
Must use the sed command.


3. The attempts at a solution (include all code and scripts):
I am not sure how to even go about this question. Still really new at shell scripting.


4. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
Calvin College, Grand Rapids MI, USA, Johnson, CO 142

Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Trying to get list of logged on users sorted

I'm trying to execute a single shell command that will give me a sorted list of all the users currently logged into the system, displaying the users name as it appears in /etc/passwd. I've tried awk -F: '{print $1}' /etc/passwd | xargs finger -s | cut -c11-28 | uniq This list whoever does... (7 Replies)
Discussion started by: kungfuice
7 Replies

2. UNIX for Dummies Questions & Answers

Need to display sorted output on 1 line!

#!/bin/bash { && ; } || { echo "Must enter between 1 and 5 parameters" exit 1 } for P do echo $P >> /tmp/task3 done echo "SORTED: $(sort -n -r /tmp/task3)" rm -f /tmp/task3 (2 Replies)
Discussion started by: knc9233
2 Replies

3. Shell Programming and Scripting

Sorted list by time of spu processing

Hi, i have to make a command in unix system which make a sorted list by cpu time (not %cpu ). If the application exists more than a time I would like to keep only one copy. Could you help me please ??? P.s : I am trying --> ps aux --sort -%cpu | uniq but I understand that is wrong (5 Replies)
Discussion started by: petros55
5 Replies

4. UNIX for Dummies Questions & Answers

write a program in c in unix that display the files(includ sub-direc and files within) in a sorted

the sorting is based on name of file, file size modification time stamps o f file it should dislay the output in the following format "." and ".." enteries should be ignored please give some idea how to do it (1 Reply)
Discussion started by: pappu kumar jha
1 Replies

5. Shell Programming and Scripting

using sed command to display contents where line numbers are stored in variables

if i want to display the contents of a file between say line number 3 and 10 then i use the following command sed -n '3,10p' filename if this 3 was contained in x and 10 was contained in y then how wud this command modified? sed -n '$x,$yp' filename does not work..please advise (2 Replies)
Discussion started by: arindamlive
2 Replies

6. Shell Programming and Scripting

Match and insert in a sorted list

I have a sorted list (python) and I want to insert a string if it matches the pattern in list. Example : Sorted List Above list is in sorted order. I need to insert a name in sorted order and also if the name already exist then it should be inserted before the existing... (1 Reply)
Discussion started by: pratapsingh
1 Replies

7. Shell Programming and Scripting

Display date in mm/dd/yy format in sed command

Hi All, Following is my issue. $MAIL_DOC = test.txt test.txt contains the following text . This process was executed in the %INSTANCE% instance on %RUNDATE%. I am trying to execute the following script var=`echo $ORACLE_SID | tr ` NOW=$(date +"%D") sed -e... (3 Replies)
Discussion started by: megha2525
3 Replies

8. Shell Programming and Scripting

Inserting lines from one file to a sorted list

Hello friends! I am working a Psychology/Neuro* project where I am sorting inline citations by category. The final step of the process has me a little stuck. I need to take citations from a text list and sort them in another text file. Here is a file X example... (1 Reply)
Discussion started by: danbroz
1 Replies

9. UNIX for Beginners Questions & Answers

UNIX command to display Owner,Group,Root and Subdirectories list

Hi Team, Am a newbie to Unix. As I would like to see the Server Name,Owner Name ( not numeric form), Group Name ( not numeric ID), ROOT path. I would like to send this list as an attachment to my personal mail. Can any one please help me out to to resolve this . Here is the sample result... (6 Replies)
Discussion started by: vasuvv
6 Replies

10. HP-UX

Display SAM user list at the command line

Hello, I've been doing Linux and AIX administration for years, but I'm very new to HPUX. We have an old audit process which involves someone manually using sam to generate user lists. I'd like to kill that old process with fire... But... After working a bit in the morning to try and pull... (3 Replies)
Discussion started by: Celt1977
3 Replies
fstadm(1M)																fstadm(1M)

NAME
fstadm - defines and manages file system stack templates SYNOPSIS
filename name] template_name template_name template_name DESCRIPTION
The command performs basic administrative operations on file system stack templates. Operations include creating and deleting templates, listing all templates on the system, and displaying the contents of templates. File system stack templates are used to describe the structure of a file system module stack. They contain information about the modules on a stack and the mount options for each module on the stack. All stack templates on a system reside in the system's stack template database. The only supported way to access and edit templates in the system template database is to use the command. The command also validates all templates at the time that they are created, to make sure that any dependency and compatibility constraints for modules on a stack are not violated. Dependency and compatibility constraints are specified by individual module developers, and enforces the constraints as needed. Note that end users do not need to be concerned about what constraints exist and how they are implemented: they only need to use to create all their templates, and will report on any problems with a user's proposed stack template. It is then easy to modify the inputs to to build a correctly validated template. Once a stack template is created and exists in the system template database, it can be used at mount time by specifying its name as a mount option. For example, the command below will mount the desired file system, with a stack described by template built above it. The file system on will now have the features of plus those of all of the modules on the stack described by Note that templates do not include information about the base file system to be mounted (e.g. or so the base file system must still be specified on the command line in the traditional way. (Support for templates that include base file systems is not included in the current versions of HP-UX.) can be invoked only by a user who has appropriate privileges. The behavior of the command depends upon the command name keyword specified as the first operand. Command Keywords and Options The following command keywords, arguments, and options are currently supported. Creates a new template. To describe a template, this command takes two types of input: o a text file that describes a template, specified with the option, or o a string that describes a template directly in the command line, specified with the option. The option cannot be used in conjunction with the option. A template can contain information about the mount options to use at each level of a stack. For information about the specific mount options that are available for each stackable file system module, consult the manpage for the module itself. The command uses the information in its input to validate and build a new template. If the new template's structure fails valida- tion, this command will abort and print an error message describing the problem. If validation succeeds, this command will create the template in the system template database and make it available for use with future mounts. The arguments that can be used with the keyword are: Specifies the name of a text file that describes the contents of a stack template. Information in the text file will be used as a guide to construct the desired stack template. The format of each line in the text file is: That is, each line of the text file describes one level of the desired stack. Within each line, a module and its mount options are separated by a single space character. The first line of the file represents the top of the stack, and the last line of the file represents the bottom. The format of these text files is identical to that of the output of the command key- word. Specifies the contents of a stack template. The format for this string is: That is, an entire stack is described within the string, and each level of a stack is separated by a semicolon Within a level, a module and its mount options are separated by a colon (But the colon does not need to be included for modules without mount options.) The leftmost module in the string represents the top of the stack, and the right-most module represents the bottom of the stack. Specifies the name of the template to be created. The maximum supported length for the template name is 128 characters. This is a required argument whenever is used. For if it is omitted, the name of the new template defaults to the name of the file specified with Overwrite option. If a template with the same name as the new template being created already exists, overwrites the old template. If this option is not specified, the command will fail whenever a template of the same name already exists. Note however that if a template of the same name exists AND is currently in use (in or the command will always fail, even if was specified. The rationale for this is that templates for stacks that are currently in use cannot be allowed to change. List all the templates in the system. This command displays the names of all templates currently stored in the system template database. Each template name is listed in its own line of output. Displays the contents of the specified template. This command will display the contents of the named template as text output, with each level of the stack described by one line of output. That is, each line of output will contain a module name, a space, and then the module's mount options (if any). The first line displayed represents the top of the stack, and the last line represents the bottom of the stack. Optionally, if it is redirected to a file, this output can also be used as input to via the option. Deletes the specified template from the system template database. If the template is currently in use (in or deletion is not allowed. In all other cases, the template will be removed from the sys- tem template database after user confirmation of the delete operation. (Template deletion is permanent and irrecoverable.) Forced delete of the specified template. Identical to but performs the deletion without asking for user confirmation. This command is provided for use by non-interactive scripts. Interactive help utility. Displays basic information about the various command keywords. RETURN VALUE
exits with one of the following values: Successful completion. An error condition occurred. Because is primarily an interactive command, an explanation of the error will be printed to standard error. EXAMPLES
List all the file system stack templates currently on the system: Display the contents of the stack template named Create a new template describing a stack that contains stacked modules named and (with module having a mount option set to 2), and name the template Delete the file system stack template named AUTHOR
was developed by HP. SEE ALSO
mount(1M). fstadm(1M)
All times are GMT -4. The time now is 01:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy