06-29-2006
Not exactly i want it to run with differnt vars and conditions depending on what flags i put out there. So i guess if i want to change vars according to a flag just do a case with the flags i want the $1... to match. but what happens if i change the order. because if i run the script "script -y -t" as i understand $1=y and $2=t so the case would only check for changing vars according to the order i put them in. How would i make it not order dependant.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Here is what I have:
#!/bin/bash
# Setup year date and month
YR=`date +%Y '{print $6}'`
MON=`date +%b '{print $2}'`
DAY=`date +%d '{print $3}'`
file=$YR$MOY$DOM
# clear
# Dump database using USER/PASS to ..sql
mysqldump --user=me -ppass database > database-db.$file.sql
The YR, MON and... (2 Replies)
Discussion started by: npereira
2 Replies
2. Shell Programming and Scripting
hello experts
cany any one help me i want to make one script which can rlogin to another machine .
but it should not ask me username/password from me of another machine it should take the username and password from the script only.
please help me out.
regards,
shary (2 Replies)
Discussion started by: shary
2 Replies
3. Shell Programming and Scripting
Hi All: I'm not much of a script writer so I could use your input. Here's the objective...
Need a script that will archive (tar) files based on date and then move them into an archive directory. The file names are as follows...
S20070101.001 Year month day
S20070102.001
As you can see... (1 Reply)
Discussion started by: jimmyc
1 Replies
4. UNIX for Dummies Questions & Answers
making a script in vi to create a shell script called wherearethey by entering the following script:
echo -n "Who are you looking for: "read userif then list=`w | grep $user | cut -c19-30` if then echo "The user $user is logged in from $list" else echo "The user $user is not logged in... (3 Replies)
Discussion started by: curtner
3 Replies
5. Shell Programming and Scripting
I have an awk script script.awk for example and want to pass a flag (let's call it "neat") so that the data is put into nice columns. For example like this
awk -v neat -f script.awk fin > fout
Then check inside the program if the use has put neat, if yes I output the lines in nice columns,... (1 Reply)
Discussion started by: kristinu
1 Replies
6. Shell Programming and Scripting
I am trying to create a program called tasklog that integrates with one of my online accounts, to keep track of what tasks I have been working on.
On login, I'd like it to display (up to) the five most recent entries, then ask me what I plan to work on during the new session. I then will type an... (3 Replies)
Discussion started by: santod
3 Replies
7. Shell Programming and Scripting
Hi,
I have the following gcov compilation flags in all the QT source code project (*.pro) files.
CONFIG(gcov) {
LIBS += -lgcov
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage
}
Now, I want to remove these flags off my files. Please help me with a script to... (1 Reply)
Discussion started by: royalibrahim
1 Replies
8. Shell Programming and Scripting
I run a small instrument lab. We track our user's time on the instruments with a very manual process of 'last wtmp.1' then cut/paste data into spreadsheets. My boss makes the initial spreadsheets then I convert and format them for uploading into our billing software (COReS). Cores is looking for a... (8 Replies)
Discussion started by: jpontius
8 Replies
9. Shell Programming and Scripting
Hello, im a new user on this site and learning scripting very slowly at a understanding pace. However i am up with a challenge and require help completing this.
The script has to include arguments, variables, decisions and loops. So the script is about calculating the broadcast address for any... (5 Replies)
Discussion started by: tHe666
5 Replies
10. UNIX for Beginners Questions & Answers
This script is executed whenever a new vehicle is added to the cycle-motor park
of campus. The script asks for the following information about the car and adds a new
line to the vehicle file.txt: name (name of an animal, unique identifier), color, mark,
model, type (e.g., electrical, manual),... (2 Replies)
Discussion started by: andre2222
2 Replies
LEARN ABOUT DEBIAN
perl::critic::policy::valuesandexpressions::requireinterpolation
Perl::Critic::Policy::ValuesAndExpressions::RequireInterUsertContrPerl::Critic::Policy::ValuesAndExpressions::RequireInterpolationOfMetachars(3pm)
NAME
Perl::Critic::Policy::ValuesAndExpressions::RequireInterpolationOfMetachars - Warns that you might have used single quotes when you really
wanted double-quotes.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
This policy warns you if you use single-quotes or "q//" with a string that has unescaped metacharacters that may need interpolation. Its
hard to know for sure if a string really should be interpolated without looking into the symbol table. This policy just makes an educated
guess by looking for metacharacters and sigils which usually indicate that the string should be interpolated.
Exceptions
o Variable names to "use vars":
use vars '$x'; # ok
use vars ('$y', '$z'); # ok
use vars qw< $a $b >; # ok
o Things that look like e-mail addresses:
print 'john@foo.com'; # ok
$address = 'suzy.bar@baz.net'; # ok
CONFIGURATION
The "rcs_keywords" option allows you to stop this policy from complaining about things that look like RCS variables, for example, in
deriving values for $VERSION variables.
For example, if you've got code like
our ($VERSION) = (q<$Revision: 4106 $> =~ m/(d+)/mx);
You can specify
[ValuesAndExpressions::RequireInterpolationOfMetachars]
rcs_keywords = Revision
in your .perlcriticrc to provide an exemption.
NOTES
Perl's own "warnings" pragma also warns you about this.
SEE ALSO
Perl::Critic::Policy::ValuesAndExpressions::ProhibitInterpolationOfLiterals
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.14.2 Perl::Critic::Policy::ValuesAndExpressions::RequireInterpolationOfMetachars(3pm)