10 More Discussions You Might Find Interesting
1. 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
2. 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
3. Shell Programming and Scripting
Hello,
I have seen this syntax,
{ ;;};quite often and I don't know what it means exactly.
It seems like a distinctive thing of Bash, so it's been used for the logo of the last bug,
ShellShock: All you need to know about the Bash Bug vulnerability | Symantec Connect
I have also seen... (3 Replies)
Discussion started by: Kibou
3 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. 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
6. Shell Programming and Scripting
Hello.
In the following :
RESTORE_FF contain a file name : a_file.tar.gz
I am testing in a directory if "a_file.tar.gz" exists and or if any file like "a_file.tar.gz" exists.
So "a_file.tar.gz" will give me file exists
So "a_file.tar.gz." will give me file exists
So... (5 Replies)
Discussion started by: jcdole
5 Replies
7. 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
8. Shell Programming and Scripting
I have a script that's meant to check the disk usage on a particular volume and delete the oldest logfile if it's over a certain percentage. It runs fine on a Linux machine, but on a Solaris one, I get this error:
diskspace_check.sh: syntax error at line 3: `diskspace=$' unexpected
I assume... (2 Replies)
Discussion started by: cara_k
2 Replies
9. 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
10. Shell Programming and Scripting
I'm trying to write a simple script that takes all the .tar.gz files in a directory and verifies them by using the gzip -tv command:
for zip in *.tar.gz
do
gzip -tv $zip
if ; then #Check return code from tar
echo "File ${zip} verified OK."
exit... (4 Replies)
Discussion started by: kelldan
4 Replies