Sponsored Content
Top Forums UNIX for Advanced & Expert Users [BASH] Read value of variable, but not comment on the same line Post 302953574 by derekludwig on Sunday 30th of August 2015 06:54:34 AM
Old 08-30-2015
Trying to emulate how the shell parses a file is going to be slower - but I guess you are trying to avoid side-effects if beSecure is true.

What functionality is the -s providing?

Also, a suggestion:
Code:
	case "$VARNAME" in
	[Pp][Aa][Ss][Ss][Ww][Oo][Rr][Dd]|[Pp][Ww]|[Pp][Aa][Ss][Ss])
		beSecure=true
		;;
	esac

could be simpified to:
Code:
	case "${VARNAME^^*}" in
	PASSWORD|PW|PASS)
		beSecure=true
		;;
	esac

Also, I am curious about this construct:
Code:
[ "$CONFFILE" = "${CONFFILE##*/}" ] && CONFFILE="./$CONFFILE"

Why are you prepending ./?
This User Gave Thanks to derekludwig For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

In bash, read to a variable with a default value to edit

My script needs to read a variable from the user. But before the user types the input, I want to give a default value so the user can edit the default value for input. How can I implement it? My script is something like: #!/bin/sh read -p 'Port number: ' -e port_number echo "Port... (7 Replies)
Discussion started by: pankai
7 Replies

2. Shell Programming and Scripting

bash: read file line by line (lines have '\0') - not full line has read???

I am using the while-loop to read a file. The file has lines with null-terminated strings (words, actually.) What I have by that reading - just a first word up to '\0'! I need to have whole string up to 'new line' - (LF, 10#10, 16#A) What I am doing wrong? #make file 'grb' with... (6 Replies)
Discussion started by: alex_5161
6 Replies

3. Shell Programming and Scripting

How to read a file line by line and store it in a variable to execute a program ?

Hello, I am quite new in shell scripting and I would like to write a little scritp to run a program on some parameters files. all my parameters files are in the same directory, so pick them up with ls *.para >>dirafter that I have a dir file like that: param1.para param2.para etc... I... (2 Replies)
Discussion started by: shadok
2 Replies

4. Shell Programming and Scripting

How to read a two files, line by line in UNIX script and how to assign shell variable to awk ..?

Input are file and file1 file contains store.bal product.bal category.bal admin.bal file1 contains flip.store.bal ::FFFF:BADC:CD28,::FFFF:558E:11C5,6,8,2,1,::FFFF:81C8:CA8B,::FFFF:BADC:CD28,1,0,0,0,::FFFF:81C8:11C5,2,1,0,0,::FFFF:81DC:3111,1,0,1,0 store.bal.... (2 Replies)
Discussion started by: veeruasu
2 Replies

5. Shell Programming and Scripting

Bash script to read a file from particular line till required line and process

Hi All, Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool. Wraper script am trying is to do with above metion 2 files. utility tool accepts : a. userinfo file : which contains username b. item file : which... (2 Replies)
Discussion started by: Optimus81
2 Replies

6. Shell Programming and Scripting

[BASH] read 'line' issue with leading tabs and virtual line breaks

Heyas I'm trying to read/display a file its content and put borders around it (tui-cat / tui-cat -t(ypwriter). The typewriter-part is a 'bonus' but still has its own flaws, but thats for later. So in some way, i'm trying to rewrite cat using bash and other commands. But sadly it fails on... (2 Replies)
Discussion started by: sea
2 Replies

7. Shell Programming and Scripting

With script bash, read file line per line starting at the end

Hello, I'm works on Ubuntu server My goal : I would like to read file line per line, but i want to started at the end of file. Currently, I use instructions : while read line; do COMMAND done < /var/log/apache2/access.log But, the first line, i don't want this. The file is long... (5 Replies)
Discussion started by: Fuziion
5 Replies

8. Shell Programming and Scripting

Ksh: Read line parse characters into variable and remove the line if the date is older than 50 days

I have a test file with the following format, It contains the username_date when the user was locked from the database. $ cat lockedusers.txt TEST1_21062016 TEST2_02122015 TEST3_01032016 TEST4_01042016 I'm writing a ksh script and faced with this difficult scenario for my... (11 Replies)
Discussion started by: humble_learner
11 Replies

9. Shell Programming and Scripting

How to read the output of a command line by line and pass it as a variable?

Hi, I have some 2000 names in a table like below. Java Oracle/SQL ANSI SQL SQL,DWH,DB DB&Java And by using for loop in my code i am able to get a single word but if there is any special character or space then it is considering as a next line. I have to execute the below queries in... (10 Replies)
Discussion started by: Samah
10 Replies

10. UNIX for Beginners Questions & Answers

Using read to assign value to bash variable not working

Hi, I am attempting to assign the output of the following command, to two bash variables, var1 and var2 using "read," but it doesn't seem to be working. # openstack hypervisor stats show | awk -F'|' 'NR==14{print $2,$3}' vcpus 92 # echo $? 0 # openstack hypervisor... (4 Replies)
Discussion started by: sand1234
4 Replies
REPORTER-BUGZILLA(1)						 LIBREPORT MANUAL					      REPORTER-BUGZILLA(1)

NAME
reporter-bugzilla - Reports problem to Bugzilla. SYNOPSIS
reporter-bugzilla [-vbf] [-g GROUP]... [-c CONFFILE]... [-F FMTFILE] [-A FMTFILE2] -d DIR Or: reporter-bugzilla [-v] [-c CONFFILE]... [-d DIR] -t[ID] FILE... Or: reporter-bugzilla [-v] [-c CONFFILE]... [-d DIR] -t[ID] -w Or: reporter-bugzilla [-v] [-c CONFFILE]... -h DUPHASH DESCRIPTION
The tool reads problem directory DIR. Then it logs in to Bugzilla and tries to find a bug with the same abrt_hash:HEXSTRING in Whiteboard. If such bug is not found, then a new bug is created. Elements of DIR are stored in the bug as part of bug description or as attachments, depending on their type and size. Otherwise, if such bug is found and it is marked as CLOSED DUPLICATE, the tool follows the chain of duplicates until it finds a non-DUPLICATE bug. The tool adds a new comment to found bug. The URL to new or modified bug is printed to stdout and recorded in reported_to element in DIR. Option -t uploads FILEs to the already created bug on Bugzilla site. The bug ID is retrieved from directory specified by -d DIR. If problem data in DIR was never reported to Bugzilla, upload will fail. Option -tID uploads FILEs to the bug with specified ID on Bugzilla site. -d DIR is ignored. Option -w adds bugzilla user to bug's CC list. Option -r sets the last url from reporter_to element which is prefixed with TRACKER_NAME to URL field. This option is applied only when a new bug is to be filed. The default value is ABRT Server" Configuration file If not specified, CONFFILE defaults to /etc/libreport/plugins/bugzilla.conf. Configuration file lines should have PARAM = VALUE format. The parameters are: Login Login to Bugzilla account. Password Password to Bugzilla account. BugzillaURL Bugzilla HTTP(S) address. (default: https://bugzilla.redhat.com) SSLVerify Use yes/true/on/1 to verify server's SSL certificate. (default: yes) Product Product bug field value. Useful if you needed different product than specified in /etc/os-release ProductVersion Version bug field value. Useful if you needed different product version than specified in /etc/os-release Parameters can be overridden via $Bugzilla_PARAM environment variables. Formatting configuration files Lines starting with # are ignored. Lines can be continued on the next line using trailing backslash. Format: "%summary summary format" "section element1[,element2]..." The literal text line to be added to Bugzilla comment. Can be empty. (Empty lines are NOT ignored!) Summary format is a line of text, where %element% is replaced by text element's content, and [[...%element%...]] block is used only if %element% exists. [[...]] blocks can nest. Sections can be: - %summary: bug summary format string. - %attach: a list of elements to attach. - text, double colon (::) and the list of comma-separated elements. Elements can be: - problem directory element names, which get formatted as <element_name>: <contents> or <element_name>: :<contents> :<contents> :<contents> - problem directory element names prefixed by "%bare_", which is formatted as-is, without "<element_name>:" and colons - %oneline, %multiline, %text wildcards, which select all corresponding elements for output or attachment - %binary wildcard, valid only for %attach section, instructs to attach binary elements - problem directory element names prefixed by "-", which excludes given element from all wildcards Nonexistent elements are silently ignored. If none of elements exists, the section will not be created. Integration with ABRT events reporter-bugzilla can be used as an ABRT reporter. Example fragment for /etc/libreport/report_event.conf: # Report Python crashes EVENT=report_Bugzilla analyzer=Python reporter-bugzilla -d . -c /etc/libreport/plugins/bugzilla.conf OPTIONS
-d DIR Path to problem directory. -c CONFFILE Path to configuration file. -b When creating bug, attach binary files too. -f Force reporting even if this problem is already reported. -F CONF_FORMAT_FILE Formatting file for initial comment. Default: /etc/libreport/plugins/bugzilla_format.conf -A CONF_FORMAT_FILE Formatting file for duplicates. Default: /etc/libreport/plugins/bugzilla_format.conf -t[ID] Upload FILEs to the already created bug on Bugzilla site. -w Add bugzilla user to CC list [of bug with this ID]. Applicable only with -t. -h, --duphash DUPHASH Search in Bugzilla by abrt's DUPHASH and print BUG_ID. -g, --group GROUP When creating a new ticket restrict access to this group only. ENVIRONMENT VARIABLES
Environment variables take precedence over values provided in the configuration file. Bugzilla_Login Login to Bugzilla account. Bugzilla_Password Password to Bugzilla account. Bugzilla_BugzillaURL Bugzilla HTTP(S) address. (default: https://bugzilla.redhat.com) Bugzilla_SSLVerify Use yes/true/on/1 to verify server's SSL certificate. (default: yes) Bugzilla_Product Product bug field value. Useful if you needed different product than specified in /etc/os-release Bugzilla_ProductVersion Version bug field value. Useful if you needed different product version than specified in /etc/os-release http_proxy the proxy server to use for HTTP HTTPS_PROXY the proxy server to use for HTTPS SEE ALSO
report_event.conf, bugzilla_format.conf AUTHORS
o ABRT team LIBREPORT 2.1.11 06/18/2014 REPORTER-BUGZILLA(1)
All times are GMT -4. The time now is 02:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy