Sponsored Content
Full Discussion: echo/print variable question
Top Forums Shell Programming and Scripting echo/print variable question Post 302450410 by riegersteve on Thursday 2nd of September 2010 01:52:04 PM
Old 09-02-2010
echo/print variable question

Code:
while read filer ; do echo $filer $1 $2; ssh $filer vfiler status -r | awk '/running/{host=$1}/Path:/{path=$2;print host,path}'; done < filers.list

this will print

Code:
node1
vfiler0 /
vfiler2 /vol/vfiler2_vol0
vfilert /vol/vfiler_vol
vfilert /vol/virt_vol

where node1 = $filer.
however how do i get $filer printed on each line, before {host=$1} ?

Last edited by Scott; 09-02-2010 at 03:03 PM.. Reason: Code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

echo or print to screen and file

I did a search for this topic but I couldn't find it and I was sure I have seen something similar before (hard because I am not sure of the criteria for the keywords) What I was looking for was to be able to echo a message to the screen from a bash.sh script at the same time logging it to a... (2 Replies)
Discussion started by: Shakey21
2 Replies

2. UNIX for Dummies Questions & Answers

echo vs. print

Is there a functional difference between echo and print? (1 Reply)
Discussion started by: PhilW
1 Replies

3. Shell Programming and Scripting

Differenc between print and echo

can anyone explain me what is the difference between echo and print in shell programming? (3 Replies)
Discussion started by: chandhar
3 Replies

4. Shell Programming and Scripting

how to print backslah using echo

how to print 3 backslah using Unix AIX, i have try in my fedora and AIX,both give dirrent output for same echo statment test.sh sed -e 's/\(\)/\\\1/g' -e 's/\$?/\\$?/g' -e 's/\$#/\\$#/g' -e 's/^/echo "/g' -e 's/$/ "/g' xMNBDF070 > xMNBDF070_test xMNBDF070 sed -e "s/'/\\\'/g" -e... (8 Replies)
Discussion started by: mani_um
8 Replies

5. Shell Programming and Scripting

Using echo to print double quotes along with variable substitution

Hi, I am generating html code using cshell, but i am having one problem while printing double quotes, I need to write following code in file. where $var contains list of web address <a href="$var">$var</a> So i am using echo "<a href="$var">$var</a>" > file.html But with this " in... (4 Replies)
Discussion started by: sarbjit
4 Replies

6. Shell Programming and Scripting

With that logic this echoes "echo". Question about echo!

echo `echo ` doesn't echoes anything. And it's logic. But echo `echo `echo ` ` does echoes "echo". What's the logic of it? the `echo `echo ` inside of the whole (first) echo, echoes nothing, so the first echo have to echo nothing but echoes "echo" (too much echoing :P):o (2 Replies)
Discussion started by: hakermania
2 Replies

7. Shell Programming and Scripting

"Simple" echo/reading variable question...

Hello, I have a simple(I think) question! Although simple, I have been unable to resolve it, so I hope someone can help! OK, here it is: 1)I have an awk script that prints something, such as: awk '{print $2}' a > x so x might hold the value of say '10' 2)Now, I just want to check to see if... (4 Replies)
Discussion started by: astropi
4 Replies

8. Shell Programming and Scripting

Print (echo) variable in a single line

Hi, I have written this code ------------------------------------------------ # !/bin/ksh i=0 while do j=$i while do echo -e $j #printf "%d",$j j=`expr $j - 1` done echo i=`expr $i + 1` done ---------------------------------------------------- The ouput which... (2 Replies)
Discussion started by: rac
2 Replies

9. Shell Programming and Scripting

Replacing echo with print

Hi everyone, I'm executing a shell script and one of the commands is creating a file with text via echo. However, if the text within echo has "\t" or similar, it automatically translates it into a TAB character, same goes for other special characters. I know that if I put another "\"... (7 Replies)
Discussion started by: demmel
7 Replies

10. Shell Programming and Scripting

Echo print on same line while loop using variable

Currently using below script but echo it print the output in two line. Input file all-vm-final-2.txt CEALA08893 SDDC_SCUN DS_SIO_Workload_SAPUI_UAT_01 4 CEALA09546 SDDC_SCUN DS-SIO-PD5_Workload_UAT_SP1_Flash_07 4 CEALA09702 SDDC_SCUN DS-VSAN-RMP-WORKLOAD01 4 DEALA08762 SDDC_LDC... (3 Replies)
Discussion started by: ranjancom2000
3 Replies
scconf_quorum_dev_netapp_nas(1M)			  System Administration Commands			  scconf_quorum_dev_netapp_nas(1M)

NAME
scconf_quorum_dev_netapp_nas - add and remove shared Network Appliance network-attached storage (NAS) quorum devices and change various NAS cluster quorum configuration properties or states. SYNOPSIS
scconf {-a|-c|-r} -q name=devicename otheroptions DESCRIPTION
Note - Beginning with the Sun Cluster 3.2 release, Sun Cluster software includes an object-oriented command set. Although Sun Cluster software still supports the original command set, Sun Cluster procedural documentation uses only the object-oriented command set. For more infor- mation about the object-oriented command set, see the Intro(1CL) man page. A Network Appliance NAS device can be configured as a quorum device for Sun Cluster. The NAS configuration information consists of: o a device name, which must be unique across quorum devices o a filer name, which defaults to the device name if not specified o a LUN ID, which defaults to 0 if not specified To provide support for NAS devices as quorum devices, the administrator must install the quorum device support module provided by Network Appliance. If this module is not available, scconfprevents the addition of the quorum device. See Sun Cluster With Network-Attached Storage Devices Manual for Solaris OS for instructions about obtaining the support module. Additionally, the iSCSI license must be valid for the Network Appliance device. OPTIONS
The following options can be used for NAS quorum devices. See scconf(1M) for the list of supported generic options. See scconf_quo- rum_dev_netapp_nas(1M) for options that are specific to shared disk quorum devices. The add and remove forms of the command are used to add and remove NAS quorum devices to or from the configuration. The change form of the command is used for changing various properties of cluster quorum configuration. Before you add a quorum device, you must set up and configure the device and the logical unit number (LUN) on the device to be configured as a quorum device. For detailed procedures, see your Network Appliance documentation. For Sun Cluster requirements of device setup, see Sun Cluster With Network-Attached Storage Devices Manual for Solaris OS. After the quorum device is added, you cannot change the type. Add a NAS quorum device: -q -a name=devicename,type=netapp_nas[,filer=filer-name][,lun_id=0] Change a NAS quorum device's configuration: -q -c name=devicename,{maintstate | reset} Remove a NAS quorum device: -q -r name=devicename The -q option supports the following Network Appliance NAS-specific suboptions: filer=filer-name Specifies the name of the device on the network that you can use to access the NAS device when you are using rsh or telnet. lun_id=0 Specifies the LUN ID on the NAS device that will be a NAS quorum device. The LUN ID defaults to 0. When scconf is interrupted or fails while performing quorum-related operations, quorum configuration information can become inconsistent in the cluster configuration database. If an inconsistency occurs, either run the same scconf command again or run it with the reset option to reset the quorum information. EXAMPLES
Example 1 Adding Network Appliance NAS Quorum Devices The following scconf command adds the Network Appliance NAS quorum device qd1. -a -q name=qd1,type=netapp_nas,filer=nas1.sun.com,lun_id=0 Example 2 Removing Network Appliance NAS Quorum Devices The following scconf command removes the Network Appliance NAS quorum device qd1. -r -q name=qd1 ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsczu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
Intro(1CL), clquorum(1CL), cluster(1CL), scconf(1M), scconf-quorum-dev-scsi(1M) Sun Cluster 3.2 10 Apr 2006 scconf_quorum_dev_netapp_nas(1M)
All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy