10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello Experts,
In one of my shell script, I've been trying to calculate mod and saving it in a variable, below is what I have tried but it isn't working.
Any help appreciated!!!
#!/bin/bash
num1=4
num2=3
echo "Number one is $num1"
echo "Number two is $num2"
mod_final=$(( echo "num1%num2"... (7 Replies)
Discussion started by: mukulverma2408
7 Replies
2. Shell Programming and Scripting
So, I've been playing with speeding up some analysis we do by using multiple threads of awk (actually, mawk, but code-compatible as far as I use it) on multiple CPU cores. So, I have a big data file and I have several copies of exactly the same processor script, written in mawk. I also have a... (8 Replies)
Discussion started by: treesloth
8 Replies
3. Shell Programming and Scripting
My .bash_profile file: source $HOME/build.variables My build.variables file: export threads="$(${threads:-$(lscpu | egrep "CPU\(s\):|Thread" | $]\)\n.
*Thread.*\(]\)@\1*\2@;Ta")])})"threads=$(lscpu | egrep "CPU\(s\):|Thread" | $]\)\n.*Thread.*\(]\)@\1*\2@;Ta")The above codes when not comment out... (7 Replies)
Discussion started by: charlieandlinux
7 Replies
4. Shell Programming and Scripting
Hello,
Although I have found similar questions, I could not find advice that could help with our problem.
The issue:
We have a few thousands text files (books).
Each book has many chapters. Each chapter is identified by a cite-key. We need
to split each of those book files by... (4 Replies)
Discussion started by: samask
4 Replies
5. Shell Programming and Scripting
I'm trying to take a users input, and then such a text file to see if it contains it.
I get an error when running it:
"./Login.sh: Line 8:
echo Username
read username
if ; then
echo Login successful.
else
echo Failed to login.
fi
If someone could give me some input to where I'm... (4 Replies)
Discussion started by: Hegarz
4 Replies
6. Shell Programming and Scripting
i want to retrieve value in each column of each row in sql plus
and save them into array variable and echo the value in array variable (2 Replies)
Discussion started by: ramish
2 Replies
7. Shell Programming and Scripting
I need to capture the homedir using the ssh command and then saving it to a variable.
The results from the following command is what I need to capture to a variable:
NOTE: the value I'm getting back is also incorrect. as it seems to be getting the home dir from the local server and not the... (2 Replies)
Discussion started by: reneuend
2 Replies
8. UNIX for Dummies Questions & Answers
Hello,
I have a shell script containing a command string in the following format:
command1 | command2 | cut -c9-16
The output from this is a record number (using characters 9-16 of the original output string) e.g. ORD-1234
I wish to save this value to a variable for use in later commands... (4 Replies)
Discussion started by: philjo
4 Replies
9. Shell Programming and Scripting
hi all i am trying to save an awk value into an array in bash:
total=`awk '{sum+=$3} END {print sum}' "$count".txt"`
((count++))
the above statement is in a while loop..
$count is to keep track of file numbers (1.txt,2.txt,3.txt,etc.)
i get the following error:
./lines1:... (1 Reply)
Discussion started by: npatwardhan
1 Replies
10. Shell Programming and Scripting
How would I pass awk output to a perl variable?
For example, I want to save the value in the 4th column into the variable called test. My best guess is something as follow, but I am sure this isn't correct.
$test = system("awk '/NUMBER/{print \$4}' $_"); (8 Replies)
Discussion started by: userix
8 Replies