Search info about awk bash instruction


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Search info about awk bash instruction
# 1  
Old 11-02-2014
Search info about awk bash instruction

hello i have search in an old .bash_history and i find this instruction :

Code:
xhost `xhost | awk -F: 'NR > 1 {printf ("-%s ", $NF)}'`


someone give me some informations about this instruction?Smilie
thx

Last edited by Don Cragun; 11-02-2014 at 11:06 PM.. Reason: Add CODE and ICODE tags.
# 2  
Old 11-02-2014
It is removing from the list any current name allow to connect to the X window system.

`xhost | awk -F: 'NR > 1 {printf ("-%s ", $NF)}'` is suppose to produce an output like -name which then, the first xhost command will use as:
Code:
xhost -name

# 3  
Old 11-03-2014
ok i understand thx you Aia for your answer Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with awk to extract additional info

Hi I use multipath linux command to get LUNs info and find out if any failed. # multipath -ll >/tmp/mpfail # cat /tmp/mpfail multipath.conf line 109, invalid keyword: user_friendly_names multipath.conf line 153, invalid keyword: user_friendly_names multipath.conf line 193, invalid... (4 Replies)
Discussion started by: prvnrk
4 Replies

2. Shell Programming and Scripting

Search strings and highlight them using Perl or bash/awk/sed

Hi, I have two files: a.doc and b.txt I wish to search the strings from file b.txt in a.doc and want to highlight them in a.doc with different colours using Perl or bash./awk/sed? Please guide me. :) Thanks!!!!! (10 Replies)
Discussion started by: bioinfo
10 Replies

3. Shell Programming and Scripting

Bash Info Display

I have written the following bash function prArgv Suppose the calling sequence is as follows prArgv VAL1 VAL2 DESC VAL3 VAL4 v2d1 s4 p15 The call will look at the tag k1v2, add the numbers together, in this case 2+1=3 This means that the function will look at the first 3 user arguments... (1 Reply)
Discussion started by: kristinu
1 Replies

4. Shell Programming and Scripting

How to use Bash and awk to search in a file?

I have the following code as a file which a user can choose with an option to search in that file. The file name is not specified and can have any name and extension. Now a sample of this file is like this: 1,root,init,20,0.0,0.1,0:01.78 1008,root,migration/0,1,2.0,1.8,7:04.32... (4 Replies)
Discussion started by: bashily
4 Replies

5. Shell Programming and Scripting

Run a bash script, display on the screen and save all information in a file including error info

Hi all, How to: Run a bash script, display on the screen and save all information in a file including error information. For example: I have a bash script called test.sh now I want to run the test.sh and display the output on the screen and save the output including error info to a file. ... (1 Reply)
Discussion started by: Damon sine
1 Replies

6. Shell Programming and Scripting

Kill -9 within Bash script kicks out usage info

I have a start|stop|restart script for a custom app we have. After it tries to stop our process the correct way, it checks to see if it's gone, if not it tries to kill it, if that doesn't work kill -9. If I run kill -9 on the PID from the command line it kills it and all is well. If I have the... (1 Reply)
Discussion started by: mglenney
1 Replies

7. Shell Programming and Scripting

how to extract info from a file using awk

Dear all I have a file call interfaces.txt Filename: interfaces.txt How can I extract the information at below? ABC_DB_001 hostname1 20901 ABC_DB_002 hostname2 20903 ABC_DB_003 hostname3 20905 Currently I am using a very stupid method grep ^ABC interfaces.txt > name.txt grep... (3 Replies)
Discussion started by: on9west
3 Replies

8. Shell Programming and Scripting

AWK - averaging $3 by info in $1

Hello, I have three columns of data of the format below: <name> <volume> <size> a 2 1.2 a 2 1.1 b 3 1.7 c 0.7 1.9 c 0.7 1.9 c 0.7 1.8 What I... (3 Replies)
Discussion started by: itisthus
3 Replies

9. Shell Programming and Scripting

some info on awk please

i know this is a stupid question but...can awk do more than print? can i have it assign a value from a file list to a variable in the script? (1 Reply)
Discussion started by: MadHatter
1 Replies
Login or Register to Ask a Question