Sponsored Content
Full Discussion: Bash script for check files
Top Forums Shell Programming and Scripting Bash script for check files Post 302976437 by RudiC on Wednesday 29th of June 2016 09:35:45 AM
Old 06-29-2016
On top of what smoofy said, the single quotes used prevent any shell expansion. I guess you want "command substitution" to take place: replace the single quotes by - deprecated - backticks or - better! - the $(...) construct.
Two more thoughts/observations:
- Do you REALLY need to prefix the absolute second file name?
- Why do you define a shell variable and then don't use it in the echo statements?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash script to check the first character in string

Hello would appreciate if somebody can post a bash script that checks if the first character of the given string is equal to, say, "a" thnx in advance (2 Replies)
Discussion started by: ole111
2 Replies

2. Shell Programming and Scripting

bash script to check if mounted, and mount if not

I'd like to make a wrapper bash script that will make sure that an nfs mount is mounted before launching a program that depends on the mount being active. Basically: 1) Check to see if the mount is active 2) If it's not active, try to mount it 3) If it won't mount because the nfs server is... (3 Replies)
Discussion started by: graysky
3 Replies

3. UNIX for Dummies Questions & Answers

Help Running a Check in Bash Script

Hey guys, so I wrote a small script that pretty much just takes in two numbers and counts from the first to the second, e.g. unknown-hacker|544> count.sh 1 3 1 2 3 My problem is I want to make it so that if you input invalid parameters, such as non-numerical characters, more than 2... (2 Replies)
Discussion started by: Duo11
2 Replies

4. Shell Programming and Scripting

bash script to check if a program is running

I'm a bit new to bash programming and I was assigned the job of writing a script that will check to see if a program server is running and to restart the program if it is not up. The script is supposed to check the program every hour (which I have looked up and I believe I know how to do) and send... (3 Replies)
Discussion started by: mcknz
3 Replies

5. Shell Programming and Scripting

bash script to check USB in linux

I need a bash script to check connected/disconnected usb with linux. I know command lsusb can be use to list down usb connect with linux. output of lsusb command is like this: Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 002: ID 0951:1643 Kingston... (1 Reply)
Discussion started by: kashif.live
1 Replies

6. Shell Programming and Scripting

Bash shell script to check if script itself is running

hi guys we've had nagios spewing false alarm (for the umpteenth time) and finally the customer had enough so they're starting to question nagios. we had the check interval increased from 5 minutes to 2 minutes, but that's just temporary solution. I'm thinking of implementing a script on the... (8 Replies)
Discussion started by: hedkandi
8 Replies

7. Shell Programming and Scripting

Password check in bash script calling on expect

password check in bash script calling on expect Background: I have to copy a file from one server, to over 100 servers in a test environment. once the file is copied, it requires to have the permissions on the file changed/verified. These are all linux servers. most of them have the same... (1 Reply)
Discussion started by: 2legit2quit
1 Replies

8. Shell Programming and Scripting

How to check day name is it saturday in bash shell script?

How to check the day name,is it saturday in bash shell script. If dayname = saturday then run the full load else run just the incremental loads end if Thank you very much for the helpful information. (4 Replies)
Discussion started by: cplusplus1
4 Replies

9. UNIX for Beginners Questions & Answers

Bash script to check the files based up on UST time.

i have 3 regions like AWS,EMEA,APJ and i use to get 3 files like a,b,c files at 3 am ust for AWS region in common shared path and x,y,z files At 10 am ust for EMEA and 1,2,3,4,5 files at 11 pm UST for APJ region. In this files name wont change daily it remain same but the file name is not same for... (2 Replies)
Discussion started by: saranath
2 Replies
INNCONFVAL(1)						    InterNetNews Documentation						     INNCONFVAL(1)

NAME
innconfval - Get configuration parameters from inn.conf SYNOPSIS
innconfval [-pstv] [-i file] [parameter ...] innconfval -C [-i file] DESCRIPTION
innconfval normally prints the values of the parameters specified on the command line. By default, it just prints the parameter values, but if -p, -s, or -t are given, it instead prints the parameter and value in the form of a variable assignment in Perl, Bourne shell, or Tcl respectively. If no parameters are specifically requested, innconfval prints out all parameter values (this isn't particularly useful unless one of -p, -s, or -t were specified). All parameters are taken from inn.conf except for version, which is always the version string of INN. If given the -C option, innconfval instead checks inn.conf, reporting any problems found to standard error. innconfval will exit with status 0 if no problems are found and with status 1 otherwise. OPTIONS
-C Check inn.conf rather than printing out the values of parameters. -i file Use file as the source configuration file rather than inn.conf. file must be a valid inn.conf file and will be parsed the same as inn.conf would be. -p Print out parameters as Perl assignment statements. The variable name will be the same as the inn.conf parameter, and string values will be enclosed in single quotes with appropriate escaping. Boolean values will be mapped to the strings "true" or "false". List values will be mapped to an array of strings. NULL values are not printed out and will therefore be "undef" in Perl. Here is an example: $enableoverview = 'true'; @extraoverviewadvertised = ( 'Newsgroups', 'Injection-Info' ); $organization = 'Let's try nasty "quotes"'; $maxforks = 10; If innconfval is called via the Perl "INN::Config" module, all these variables are properly exported. -s Print out parameters as Bourne shell assignment statements. The variable name will be the inn.conf parameter name in all capitals, and all variables will be exported, if not NULL. String values will be enclosed in single quotes with appropriate escaping, and boolean values will be mapped to "true" or "false". List values will be mapped to a space-separated string representing an array of strings (as Bourne shell does not recognize arrays, contrary to several other shells, an array cannot be returned for interoperability reasons). Here is an example: ENABLEOVERVIEW=true; export ENABLEOVERVIEW; EXTRAOVERVIEWADVERTISED='"Newsgroups" "Injection-Info"'; export EXTRAOVERVIEWADVERTISED; ORGANIZATION='Let'''s try nasty "quotes"'; export ORGANIZATION; MAXFORKS=10; export MAXFORKS; -t Print out parameters as Tcl assignment statements. The variable name will be the same as the inn.conf parameter name but with "inn_" prepended, and string variables will be escaped appropriately. Boolean values will be mapped to the strings "true" or "false". List values will be mapped to an array of strings. NULL values are not printed out. Here is an example: set inn_enableoverview "true" set inn_extraoverviewadvertised { "Newsgroups" "Injection-Info" } set inn_organization "Let's try nasty "quotes"" set inn_maxforks 10 -v Print INN's version. This is equivalent to "innconfval version". HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. $Id: innconfval.pod 8919 2010-01-22 23:29:28Z iulius $ SEE ALSO
inn.conf(5), INN::Config(3pm). INN 2.5.2 2010-02-08 INNCONFVAL(1)
All times are GMT -4. The time now is 10:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy