Sponsored Content
Top Forums Shell Programming and Scripting Pulling correct value from Mapfile Post 302331006 by MrKen on Friday 3rd of July 2009 04:35:30 AM
Old 07-03-2009
reddybs, thanks for your reply.

If I change "[$client]" to $client, then I get no hostname output.
If I use -w with grep, then I get no hostname output.

So now I have this, but still the output is incorrect.
Code:
echo Client is $client
echo

# get hostname from the Hostsfile
hostname=`grep "[$client]" $ZABBIX_HOSTSFILE | cut -f2 -d:` ; echo $hostname

and the output:
Code:
Client is "BaculaServer-fd"

Server_Helpdesk Server_Knowledge Server_Bacula Server_Zabbix_1.4.2

Any more ideas?
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Pulling out fields from a file

Hi, I have a file that contains 1400 lines similar to the one shown below: NAME=sara, TOWN=southampton, POSTCODE=SO18777, EMAIL=sara@hotmail.com, PASSWORD=asjdflkjds etc etc (note: this is one line). Each line has the same fields, but on each line they are in a different order. Eg. the line... (2 Replies)
Discussion started by: Saz
2 Replies

2. UNIX for Dummies Questions & Answers

pulling the following line from a file

I have return files from a process that has then original input record followed on the next line by a response record..either AA,........... for accepted or EE,.......... for errored. i.e 11,new,123 AA,accepted 12,exist,443 EE,rejected 13,old,223 AA,accepted I want to write a small... (4 Replies)
Discussion started by: peter.herlihy
4 Replies

3. Shell Programming and Scripting

Pulling data and following lines from file

I saw a few posts close to what i want to do, but they didn't look like they would work exactly.. or I need to think out of the box on this. I have a file that I keep server stats in for my own performance analysis. this file has the output from many commands in it (uptime, vmstats, ps, swap... (2 Replies)
Discussion started by: MizzGail
2 Replies

4. Shell Programming and Scripting

Pulling the first and last character/number from a string.

Let's say I have a word "foobar23" in a file, and I want to pull the first "f" and last "3" character out of the world, how would I accomplish that? # cat file foobar23 I want the output to be: f3 (3 Replies)
Discussion started by: LinuxRacr
3 Replies

5. Shell Programming and Scripting

Capacity of directory... Pulling hair out :-)

I am new to scripting and thought I was doing rather well however I ran into a issue and I am not sure how to fix it. I am using the following command to obtain the capacity percent of the directory listed however it seems that this command gets the capacity of the whole mount rather then just the... (8 Replies)
Discussion started by: LRoberts
8 Replies

6. Shell Programming and Scripting

pulling out the value from rows

Hi, I'm trying to pull all occurrence of value , for example "xy1234" from several rows, out of a file. The file might as well contain other different type of rows. 20100121 04:00:02 37a00452 <ABCN:ABXC> From MV Modify <uid=xy1234,ou=Internal2,ou=people,dc=abc,dc=example1,dc=com> I am trying... (4 Replies)
Discussion started by: john_prince
4 Replies

7. Shell Programming and Scripting

Pulling remote hostname into variable

I'm trying to write a shell script using bash that connects to a remote server, runs a command that generates a file, pulls the file over, then renames it with the hostname of the remote server and a an extension. So far, I'm able to everything but pull the hostname of the remote server into a... (2 Replies)
Discussion started by: hobbes80
2 Replies

8. Shell Programming and Scripting

Strange behavior with readarray (aka mapfile)

$ readarray list <<< "a b c d e f g" $ echo ${list} a b c d e f g $ echo "a b c d e f g" | readarray list2 $ echo ${list2} a blank lineI read a post the same thing happens with cat vs < on another forum but the poster did not know why. Any ideas? Mike (3 Replies)
Discussion started by: Michael Stora
3 Replies

9. Shell Programming and Scripting

Pulling data from xml

Hi there, Please could anyone help with this. I have an xml file that contains repeating values eg <Rule name> AAAAA <Action> BBBBB </Action> <Data> CCCCC </Data> <Type> DDDDD </Type> </Rule name> <Rule name> A1A1A1A1 <Action> B1B1B1B1 </Action> <Data> C1C1C1C </Data> <Type>... (4 Replies)
Discussion started by: ssideel
4 Replies

10. Shell Programming and Scripting

Partial file pulling

I am connecting to another server through sftp. I am running one batch script to pull file from another server. sometimes i am receiving partial files. I am using below commands in batch script. ls -ltr new.txt mget new.txt bye The file is of 1 MB only.In most of the cases , i received... (6 Replies)
Discussion started by: srinath01
6 Replies
BACKUPLOG(5)							AFS File Reference						      BACKUPLOG(5)

NAME
BackupLog - Traces Backup Server operations DESCRIPTION
The BackupLog file records a trace of Backup Server (buserver process) operations on the local machine and describes any error conditions it encounters. If the BackupLog file does not already exist in the /var/log/openafs directory when the Backup Server starts, the server process creates it and writes initial start-up messages to it. If there is an existing file, the Backup Server renames it to BackupLog.old, overwriting the existing BackupLog.old file if it exists. The file is in ASCII format. Administrators listed in the /etc/openafs/server/UserList file can use the bos getlog command to display its contents. Alternatively, log on to the machine and use a text editor or a file display command such as the UNIX cat command. By default, the mode bits on the BackupLog file grant the required "r" (read) permission to all users. The Backup Server records operations only as it completes them, and so cannot recover from failures by reviewing the file. The log contents are useful for administrative evaluation of process failures and other problems. SEE ALSO
UserList(5), bos_getlog(8), buserver(8) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 BACKUPLOG(5)
All times are GMT -4. The time now is 02:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy