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
// 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
3. 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
4. Shell Programming and Scripting
Needing a hint. Creating that function called Meter my simple script works well. What I want now is to start the last four commented lines to include or trigger a reaction, if there are more than n lines in that .txt-file it shall display that message for example. But the interpreter says there is... (3 Replies)
Discussion started by: 1in10
3 Replies
5. Shell Programming and Scripting
Hi,
I'm a Delphi developer new to linux, new to this forums and new to BASH programming and got a new task in my work: maintaining an existing set of BASH scripts. First thing I want to do is making the code more reliable as in my opinion it's really bad written. So here's the quest:
I'm... (6 Replies)
Discussion started by: rse
6 Replies
6. Shell Programming and Scripting
hi all ,
i just tried to take the status of previous command inside the script using
echo $?. It throws me a variable syntax error , but when i use echo $? as an individual command it works perfectly .
can anyone Please tell me why am getting a variable syntax error when i use echo $?... (7 Replies)
Discussion started by: Rahul619
7 Replies
7. Shell Programming and Scripting
Hi All,
I am getting a syntax error message while trying to compare 2 files using the compare function (LINUX)
command substitution: line 79: syntax error near unexpected token `('
command substitution: line 79: `cmp -s <(tr , \n < $COMMON_TMP/nt_per_gs.done | sort) <(tr , \n <... (5 Replies)
Discussion started by: dsfreddie
5 Replies
8. 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
9. 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
10. Shell Programming and Scripting
Hello.
Looking for a method of modularizing my bash script, I am stuck with such a problem. For example, I have:
MODULE_NAME="test"
FUNCTION_NAME="run"
How do I can a function with name test_run? (4 Replies)
Discussion started by: FractalizeR
4 Replies