09-02-2008
Thanks Era.. I don't know why I didn't see it earlier... much appreciated.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to create a shell that asks the user to enter their name, and compare it to my own by saying we have the same name or saying my name and that they have a nice name too. Here is my script...
#!/bin/bash-x
echo "Enter your name".
read name
if
then
echo "My name is Adam too"... (1 Reply)
Discussion started by: amaxey45
1 Replies
2. Shell Programming and Scripting
I'm running mysql in a bash script
mysql <<EOF
query
EOF
one query is like this:
UPDATE $dbname.$prefix"config" SET value = $var WHERE "$prefix"config.name = 'table colname';
with variable
but it's giving an error
i'm not sure what to put for
"$prefix"config.name
the table... (3 Replies)
Discussion started by: vanessafan99
3 Replies
3. Web Development
ec2addtag --region us-west-1 vol1234 --tag Name=$nameinst;
It should execute
ec2addtag --region us-west-1 vol1234 --tag Name=webserver;
Instead it thinks that Name is equal to that variable. Please help. Thanks!
Please use code tags! (0 Replies)
Discussion started by: svalenciatech
0 Replies
4. Shell Programming and Scripting
while read line
do
mkdir $line
scp -r Docking_results/docking_$line.pdb $line/
cd /$line/
set a=`grep ENDMDL docking_'$line'.pdb | wc -l`
set b=`expr $a - 2`
csplit -k -s -n 3 -f docking_'$line'. docking'$line'.pdb '/^ENDMDL/+1' '{'$b'}'
foreach f (... (4 Replies)
Discussion started by: chrisjorg
4 Replies
5. Shell Programming and Scripting
howdy,
so I'm make a plugin work for Nagios, and the commandline is:
/usr/lib/nagios/plugins/check_mssql -H MySQLServerName -u MySqlAccountName -p MyPassword(#XXXXX -d MyDatabaseName
it is barfing with:
bash: syntax error near unexpected token `('
Thoughts?
Do I have to wrap something... (2 Replies)
Discussion started by: rgouette
2 Replies
6. Shell Programming and Scripting
// AIX 6.1
I am getting a syntax error below. Please advise what to be corrected. :confused:
runmqsc CERN.$(echo `hostname` | cut -d'.' -f1 | tr '' '').$(echo $environment | tr '' '') <<! | egrep -i '(FROM.NC.APPLIANCE)' | sort -u |awk '{print $2}' | cut -d '(' -f2 | cut -d ')' -f1 |... (1 Reply)
Discussion started by: Daniel Gate
1 Replies
7. Shell Programming and Scripting
The below bash function uses multiple variables CODING, SAMPLE, SURVEY, andvariant
in it. The user selects the cap function and details are displayed on the screen using the $SURVEY variable, the directory is changed to $SAMPLE and the samples.txt is opened so the user can select the sample to... (6 Replies)
Discussion started by: cmccabe
6 Replies
8. Shell Programming and Scripting
In the bash function below if the user selets "y" then the menu function is called and if they select "n" the move function is called. That all seems to work, my question is after the files are moved an echo,
line in bold is displayed and another function called backup is called. I am getting a... (1 Reply)
Discussion started by: cmccabe
1 Replies
9. BSD
#!/bin/bash
#--------------------------------------------------------
# Setup prompt
# Author Zeeshan Mirza
# Data: 06-08-2017
#--------------------------------------------------------
if
then
. ./.profile_custom_pre
fi
umask 022
set -o vi
export EDITOR=vi
export VISUAL=vi... (3 Replies)
Discussion started by: getzeeshan
3 Replies
10. Shell Programming and Scripting
I am sharing a code snippet.
for (( i=0; i<=$(( $count -1 )); i++ ))
do
first=${barr2}
search=${barr1}
echo $first
echo "loop begins"
for (( j=0; j<=5000; j++ ))
do
if } == $search ]]; then
echo $j
break;
fi
done
second=${harr2}
echo $second (2 Replies)
Discussion started by: ngabrani
2 Replies
less(3pm) Perl Programmers Reference Guide less(3pm)
NAME
less - perl pragma to request less of something
SYNOPSIS
use less 'CPU';
DESCRIPTION
This is a user-pragma. If you're very lucky some code you're using will know that you asked for less CPU usage or ram or fat or... we just
can't know. Consult your documentation on everything you're currently using.
For general suggestions, try requesting "CPU" or "memory".
use less 'memory';
use less 'CPU';
use less 'fat';
If you ask for nothing in particular, you'll be asking for "less 'please'".
use less 'please';
FOR MODULE AUTHORS
less has been in the core as a "joke" module for ages now and it hasn't had any real way to communicating any information to anything.
Thanks to Nicholas Clark we have user pragmas (see perlpragma) and now "less" can do something.
You can probably expect your users to be able to guess that they can request less CPU or memory or just "less" overall.
If the user didn't specify anything, it's interpreted as having used the "please" tag. It's up to you to make this useful.
# equivalent
use less;
use less 'please';
"BOOLEAN = less->of( FEATURE )"
The class method "less->of( NAME )" returns a boolean to tell you whether your user requested less of something.
if ( less->of( 'CPU' ) ) {
...
}
elsif ( less->of( 'memory' ) ) {
}
"FEATURES = less->of()"
If you don't ask for any feature, you get the list of features that the user requested you to be nice to. This has the nice side effect
that if you don't respect anything in particular then you can just ask for it and use it like a boolean.
if ( less->of ) {
...
}
else {
...
}
CAVEATS
This probably does nothing.
This works only on 5.10+
At least it's backwards compatible in not doing much.
perl v5.16.3 2013-02-26 less(3pm)