Sponsored Content
Homework and Emergencies Homework & Coursework Questions bash error checking problems[solved] Post 302714641 by vbe on Friday 12th of October 2012 11:16:07 AM
Old 10-12-2012
Just teasing a bit...
What if you change directory ( see me coming?...)
what would be the output of region=$(ls zoneinfo| grep "$1")?

...
assuming zoneinfo is in $HOME:
Code:
region=$(cat ~/zoneinfo | grep "$1")
echo $region
if [ "$region" = "" ]
then
    echo $1 does not exist
    exit 2
fi


Last edited by vbe; 10-12-2012 at 12:39 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

error checking in bash

Could someone please advise on a good way to implement error checking in a script? i am taking input from a file, iserting it's values into two commands and sending the output of each to seperate log files. i need to check those log files for for an occurance of 'error', stop the command if... (3 Replies)
Discussion started by: gubten
3 Replies

2. UNIX and Linux Applications

Kudda has successfully solved the downloading problems for numerous video web

The rise of Video web stimulates more intuitive video feeling of large people, and makes video downloading becomes a popular trend in web times, meanwhile, more and more downloading problems arises correspondingly, in which the first trouble is slow downloading speed and incomplete downloading. It... (0 Replies)
Discussion started by: angelstar
0 Replies

3. Shell Programming and Scripting

bash if loop for checking multiple parameters

Hello, I've got next problem: I want to examine at the beginning of a script in an if loop that: 1. Is there 4 parameters given 2. If first state is true then: is there switches -e and -d? 3. At the end, how can i indentify them as variebles regardlees to its order. I was thinking like... (2 Replies)
Discussion started by: szittyafergeteg
2 Replies

4. Shell Programming and Scripting

bash: checking file size -solved

Hello I have srv RHEL5, file system UTDM (EMC DiskXtender Unix/Linux File System Manager 3.5 & EMC Centera). it all works under the scheme: have disk is formatted with a file system UTDM, drive open network - NFS, it write data, then migrate the data in the repository - EMC Centera. There are... (0 Replies)
Discussion started by: moskovets
0 Replies

5. Shell Programming and Scripting

[Solved] <<EOF error checking

I am trying to check the return status of a command thats encapsulated in an <<EOF #!/bin/ksh set -x xxx() { set -x ls -lt /tmp/jdlkewjdlkewjdlkewjdlewjdlew<<EOT ret=$? EOT echo "ret=$ret" } >>$LOG 2>&1 LOG=/tmp/t2.out rm -rf $LOG echo "Starting process `date... (2 Replies)
Discussion started by: BeefStu
2 Replies

6. AIX

problems connecting with exceed (solved)

Hi, We have a user who cannot connect to the aix system anymore with hummingbird exceed. Our unix servers are aix 5.3. She is running windows xp and using hummingbird 12. She used to not have any problem, but now when she tries to use xstart she gets an error 'unable to connect to host using... (0 Replies)
Discussion started by: fwellers
0 Replies

7. HP-UX

Solved -- Problems with NIS Password Expiration...

HI. I was wondering if anyone can assist me in this. I have an HP-UX 11.31 server at work which keeps expiring my NIS password. I cannot log in unless I use root access. It worked before and I think some of the settings changed since then. My boss has told me that since we're taking some... (1 Reply)
Discussion started by: zixzix01
1 Replies

8. Shell Programming and Scripting

Multiple condition checking in bash

Hi All, I am trying to check if two variables have value assigned to it. i am doing it like if ] then echo "Please specify either single hostname or host file for the report" usage exit fi But its not working for it.Even i specify values for both variables it dont go... (6 Replies)
Discussion started by: kailash19
6 Replies

9. Shell Programming and Scripting

checking first argument for tag in bash script

I have a bash script where I pass an argument ./chris.bash "\argv Test" I want to detect if the user supplied \argv at the start of the argument (3 Replies)
Discussion started by: kristinu
3 Replies

10. Shell Programming and Scripting

Bash : Checking Large file for specific lines

Morning .. I have a file with approximately 1000 lines. I want to check that the file contains, for example, 100 lines. Something like whats given below is ugly. And even if I create a function I have to call it 100 times. I may need to look through multiple files at times. Is there a... (4 Replies)
Discussion started by: sumguy
4 Replies
DEBCONF-MERGETEMPLATE(1)					      Debconf						  DEBCONF-MERGETEMPLATE(1)

NAME
debconf-mergetemplate - merge together multiple debconf template files SYNOPSIS
debconf-mergetemplate [options] [templates.ll ...] templates DESCRIPTION
Note: This utility is deprecated. You should switch to using po-debconf's po2debconf program. This program is useful if you have multiple debconf templates files which you want to merge together into one big file. All the specified files will be read in, merged, and output to standard output. This can be especially useful if you are dealing with translated template files. In this case, you might have your main template file, plus several other files provided by the translators. These files will have translated fields in them, and maybe the translators left in the english versions of the fields they translated, for their reference. So, you want to merge together all the translated templates files with your main templates file. Any fields that are unique to the translated files need to be added in to the correct templates, but any fields they have in common should be superseded by the fields in the main file (which might be more up-to-date). This program handles that case properly, just list each of the translated templates files, and then your main templates file last. OPTIONS
--outdated Merge in even outdated translations. The default is to drop them with a warning message. --drop-old-templates If a translation has an entire template that is not in the master file (and thus is probably an old template), drop that entire template. SEE ALSO
debconf-getlang(1) AUTHOR
Joey Hess <joeyh@debian.org> 2012-09-10 DEBCONF-MERGETEMPLATE(1)
All times are GMT -4. The time now is 10:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy