Sponsored Content
Homework and Emergencies Homework & Coursework Questions Using ls or echo to display a specific output Post 302608210 by vbe on Friday 16th of March 2012 12:14:48 PM
Old 03-16-2012
I was wondering more: to what point do you call something you type at the prompt "single command line"...
For I dont get how it is possible to display the 2 first lines with the following...
Unless you have find with fancy options we dont know...
Here are variants on ONE line:
Code:
lo4:/export/home/vbe $ ls -lrhid sample"/./";ls -lidhFR sample/*/.*| grep 2711
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/./
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/paper/../
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/test/../
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/text/../
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/work/../
lo4:/export/home/vbe $ ls -liRdF sample/.* |grep 2711 
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/./
lo4:/export/home/vbe $ for i in sample sample"/." sample/*/.* ; do ls -lidRF $i|grep 2711;done
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/./
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/paper/../
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/test/../
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/text/../
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/work/../
lo4:/export/home/vbe $ for i in sample sample"/." sample/*/.. ; do ls -lidF $i;done           
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/./
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/paper/../
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/test/../
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/text/../
      2711 drwxr-xr-x   6 vbe      sysdso         6 Mar 16 16:02 sample/work/../

Are you sure you understood with what we are to solve (just ls or find?...)?
Thrcky bit is not much /../ but to get / , /./ and /../ together in one pass... It has to do with th inode itself but its friday I am a bit tired... and lack of imagination at the time...

Last edited by vbe; 03-16-2012 at 02:50 PM.. Reason: typos
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Display from a variable using echo.

I have a variable that is outputting a lot of space. here has been 45 lines returned ... how can I remove the spaces between the "been and the 45" CODE: fil_len=`wc -l < coshb.txt` if ; then cat coshb.txt | more echo " " echo "There has been ${fil_len} lines... (4 Replies)
Discussion started by: jagannatha
4 Replies

2. Shell Programming and Scripting

what does echo $$ command display

whats the value stored in $$ (2 Replies)
Discussion started by: suri
2 Replies

3. UNIX for Dummies Questions & Answers

how to display specific lines of a specific file

are there any basic commands that can display lines 99 - 101 of the /etc/passwd file? I'm thinking use of head and tail, but I forget what numbers to use and where to put /etc/passwd in the command. (2 Replies)
Discussion started by: raidkridley
2 Replies

4. Shell Programming and Scripting

Display echo results in three column

Dear Friends, I have my command output which displays on one row and values are now scrollable (vertical) 3 pages. How do i display those output in three column so that i no need to scroll? Example: dcadd$cat components 1.Caluculator 2.Diary ... ... 50.Mobile 51.Battery .. ...... (12 Replies)
Discussion started by: baluchen
12 Replies

5. Shell Programming and Scripting

echo display problem

Hi I am facing a strange problem a=03 echo ${a} the output is 3 But i want to display it is 03 Can you people help me how to display it like 03. Thanks (2 Replies)
Discussion started by: aishsimplesweet
2 Replies

6. Shell Programming and Scripting

Help with ksh script to display output with specific contents

This is Input - starts with Storage Group Name and ends with Shareable and the loop continues all I need is Storage group name and Alu numbers in the below output format requested. Storage Group Name: abcd Storage Group UID: 00:00:000:00:0:0:0 HBA/SP Pairs: HBA UID ... (6 Replies)
Discussion started by: maddysa
6 Replies

7. UNIX and Linux Applications

display which line returns specific output

Hi, I'm trying to figure out a way to find which line in my file.txt with IP addresses: 192.168.0.1 192.178.0.2 etc... returns specific result when I execute command affecting all lines. For example when I run: for line in `cat file.txt`; do snmpget $line done it displays the... (5 Replies)
Discussion started by: svetoslav_sj
5 Replies

8. Shell Programming and Scripting

display echo only once

lets say I am printing something out echo "Please enter a valid username" and its being printed out 5 times, is there any way I can limit to only being displayed ONCE. I tried echo -n but that just makes everything fit on one line. Right now it keeps saying Please enter a valid... (5 Replies)
Discussion started by: subway69
5 Replies

9. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

10. Shell Programming and Scripting

How do we display specific row of an output from bottom given line number?

I pass a number to my script. Passing "1" below. ./getfile.sh 1 echo "User entered: $1" ls -ltr *.conf | sed -n '$p' I wish to use ls -ltr i.e list files in ascending order of time the latest showing at the bottom of the output. Number 1 should get me the last row of ls -ltr output i.e... (9 Replies)
Discussion started by: mohtashims
9 Replies
GLGETMULTISAMPLEFV(3G)						   OpenGL Manual					    GLGETMULTISAMPLEFV(3G)

NAME
glGetMultisamplefv - retrieve the location of a sample C SPECIFICATION
void glGetMultisamplefv(GLenum pname, GLuint index, GLfloat *val); PARAMETERS
pname Specifies the sample parameter name. pname must be GL_SAMPLE_POSITION. index Specifies the index of the sample whose position to query. val Specifies the address of an array to receive the position of the sample. DESCRIPTION
glGetMultisamplefv queries the location of a given sample. pname specifies the sample parameter to retrieve and must be GL_SAMPLE_POSITION. index corresponds to the sample for which the location should be returned. The sample location is returned as two floating-point values in val[0] and val[1], each between 0 and 1, corresponding to the x and y locations respectively in the GL pixel space of that sample. (0.5, 0.5) this corresponds to the pixel center. index must be between zero and the value of GL_SAMPLES - 1. If the multisample mode does not have fixed sample locations, the returned values may only reflect the locations of samples within some pixels. ERRORS
GL_INVALID_ENUM is generated if pname is not one GL_SAMPLE_POSITION. GL_INVALID_VALUE is generated if index is greater than or equal to the value of GL_SAMPLES. SEE ALSO
glGenFramebuffers(), glBindFramebuffer() COPYRIGHT
Copyright (C) 2010 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. AUTHORS
opengl.org opengl.org 06/10/2014 GLGETMULTISAMPLEFV(3G)
All times are GMT -4. The time now is 02:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy