10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How to return a exit code from a function and use it in conditional?
I tried the following but it does not seem to work.
tests.sh:
if test ./load.sh ; then
echo "0"
else
echo "1"
fi
load.sh:
return 1;
from command line:
$ ./tests.sh
0
I was expecting it to output "1"... (17 Replies)
Discussion started by: wolfv
17 Replies
2. Shell Programming and Scripting
Hi,
I'm clueless why this doesn't work. I have tried both cat and awk together and just awk on its own as well, the output just returns the first line of the input file.
#!/bin/sh
for i in $(seq 2 2 40)
do
cat data_final.txt | awk -v indevarx=$i '$1<=indexvar && $1>indexvar-2'... (2 Replies)
Discussion started by: jamie_123
2 Replies
3. Shell Programming and Scripting
Hi, I have two files: atom.txt and g.txt
atom.txt has multiple patterns but I am showing only two patterns each ending with ENDMDL:
ATOM 1 N SER A 1 35.092 83.194 140.076 1.00 0.00 N
ATOM 2 CA SER A 1 35.216 83.725 138.725 1.00 0.00 C
TER
ENDMDL
ATOM 1 N SER A 1 35.683 81.326 139.778 1.00... (11 Replies)
Discussion started by: bioinfo
11 Replies
4. UNIX for Dummies Questions & Answers
Hi, I am also a newbie in awk and trying to find solution of my problem.
I have one reference file 1.txt with 2 columns and I want to search other 10 files (a.txt, b.txt......h.txt each with 5 columns) corresponding to the values of 2nd column from 1.txt. If the value from 2nd column from 1.txt... (0 Replies)
Discussion started by: bioinfo
0 Replies
5. Shell Programming and Scripting
Hi,
I'm trying to read a file containing lines with spaces in them.
The inputfile looks like this
------------------------------
Command1 arg1 arg2
Command2 arg5 arg6 arg7
-------------------------------
The shell code looks like this...
lines=`awk '{ print }' inputfile`
... (2 Replies)
Discussion started by: a-gopal
2 Replies
6. Shell Programming and Scripting
Hello all,
I would like to know if it is possible to return a the result of a boolean expression from a function like this
function()
{
# some code
return ||
}
and what will be the return value ?
Thank you for help. (6 Replies)
Discussion started by: dolphin06
6 Replies
7. Shell Programming and Scripting
Hi All,
I am new to shell scripting and right now I am just limited to using the pre-written scripts. I am in to Infrastructure management where we use different scripts to get the information passed on to the monitoring tools. I am trying to use this script to get the information about the... (2 Replies)
Discussion started by: theamrit
2 Replies
8. Shell Programming and Scripting
Hello,
I have a file.txt with 20000 lines and 2 columns each which consists of current_filename and new_filename . I want to create a script to find files in a directory with current_filename and move it to new folder with new_filename.
Could you please help me how to do that??
... (2 Replies)
Discussion started by: narasimhulu
2 Replies
9. Shell Programming and Scripting
Hi
Running a specific nawk statement over a 17m lines files returns the following:
/bin/nawk: not enough args in .....
input record number 1,25955e+06, file test.1
source line number 1
I'd like to report the line number (in bold above) in decimal not floating so that i can spot it out.
... (1 Reply)
Discussion started by: moutaye
1 Replies
10. Solaris
Hi
Running a specific nawk statement over a 17m lines files returns the following:
/bin/nawk: not enough args in .....
input record number 1,25955e+06, file test.1
source line number 1
I'd like to report the line number (in bold above) in decimal not floating so that i can spot it out.
... (1 Reply)
Discussion started by: moutaye
1 Replies