Sponsored Content
Special Forums UNIX and Linux Applications display which line returns specific output Post 302593466 by ahamed101 on Friday 27th of January 2012 01:56:13 AM
Old 01-27-2012
Use printf instead of echo

Code:
while read line
do
  printf $line
  snmpget $line
done < file.txt

--ahamed
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can't figure out how to display specific data from a line using awk.

Hello, I cannot figure this one out. I would like to do the following. I have a line that has 7 words. It is possible that the line can have 20 words too. I always want to show the 9th word and beyond. The 9th word will always change so I do not have something to search for, so I think... (1 Reply)
Discussion started by: ctcuser
1 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

Getting output a line after specific line

Hi I am a rookie and I would like to know how to make a script that prints as a output lines between two lines let say first variable is a : Mon Aug 31 09:00:00 2009 CET and the last line is Tue Sep 08 09:00:00 2009 CET also lets say third line from Mon Aug 31 09:00:00... (3 Replies)
Discussion started by: DinoFly
3 Replies

4. Shell Programming and Scripting

Remove a specific line from grep output string

Dear All I want to search string "1000" from input file and if it found i want remove line that contain 1000 and also remove 3 line above it and 2 line below it. INPUT FILE: BHAT-D 2 aaa ID CODE GS UPDATE MODE LANG MCO MCL NUMPAGES 50 ... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies

5. Shell Programming and Scripting

for loop returns more output with awk

I need to get total number of hdisk not assigned to any VGs. PDC # lspv |grep None |awk '{print $1}' |wc 131 131 1099 So, it shows 131 hdisks. I need to look at the individual hdisk fget_config info like below: PDC # fget_config -Av |grep hdisk230 hdisk230 dac1 229... (4 Replies)
Discussion started by: Daniel Gate
4 Replies

6. Shell Programming and Scripting

Display Specific line number using tail command

Hi , 1)i want to display specific line number using tail command. e.g. display 10 line from end. Please help... 2)Want to display line 10 to 15 (from end)using tail command) (2 Replies)
Discussion started by: vivek1489
2 Replies

7. 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

8. Homework & Coursework Questions

Using ls or echo to display a specific output

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: What single command line would you enter to get the following output? 8140 drwxr-xr-x 9 root bin 18 Jan 20... (6 Replies)
Discussion started by: dasboot
6 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
tgt-setup-lun(8)					      System Manager's Manual						  tgt-setup-lun(8)

NAME
tgt-setup-lun - creates a target, adds a device to the target and defines initiators that can connect to the target SYNOPSIS
tgt-setup-lun -d device -n target_name [initiator_IP1 initiator_IP2 ...] [-h] DESCRIPTION
Starts tgtd if necessary and creates a target according to the supplied target_name. The format of the target name is as follows: iqn.2001-04.com.<hostname>-<target_name> The target name must be unique. The script then adds the requested device to the target. If specific IP addresses are defined, it adds them to the list of allowed initia- tors for that target. If no IP addresses is defined, it defines that the target accepts any initiator. EXAMPLES
Create a target that uses /dev/sdb1 and allows connections only from 192.168.10.81: tgt-setup-lun -d /dev/sdb1 -n my_target 192.168.10.81 Create a target that uses /dev/sdb1 and allows connections only from 192.168.10.81 and 192.168.10.82: tgt-setup-lun -d /dev/sdb1 -n my_target 192.168.10.81 192.168.10.82 Create a target that uses /dev/sdb1 and allows connections from any initiator: tgt-setup-lun -d /dev/sdb1 -n my_target Display help: tgt-setup-lun -h AUTHOR
Written by Erez Zilber REPORTING BUGS
Report bugs to <erezz@voltaire.com>. COPYRIGHT
Copyright (C) Voltaire Ltd. 2008. tgt-setup-lun(8)
All times are GMT -4. The time now is 09:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy