10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
We have wrote shell script for multiple file name search pattern.
file format: <numner>_<20180809>.txt
starting with single number and ending with 8 digits number
Command:
awk -v string="12_1234" -v serch="^+_+$" "BEGIN{ if (string ~/serch$/) print string }"
If sting matches... (4 Replies)
Discussion started by: koti_rama
4 Replies
2. Shell Programming and Scripting
Input:
|Running the Rsync|Sun Oct 16 22:48:01 BST 2016
|End of the Rsync|Sun Oct 16 22:49:54 BST 2016
|Running the Rsync|Sun Oct 16 22:54:01 BST 2016
|End of the Rsync|Sun Oct 16 22:55:45 BST 2016
|Running the Rsync|Sun Oct 16 23:00:02 BST 2016
|End of the Rsync|Sun Oct 16 23:01:44 BST 2016... (4 Replies)
Discussion started by: busyboy
4 Replies
3. Shell Programming and Scripting
Hi,
Here is the script i try to perform arithmetic operation in two variables .
git branch -r | while read brname ; do
REV_COMMITS=`git rev-list --count $brname`
echo "$brname has $REV_COMMITS"
(( TOTAL = TOTAL + REV_COMMITS ))
echo "in loop" $TOTAL
done
echo "total is " $TOTAL
... (3 Replies)
Discussion started by: greet_sed
3 Replies
4. Programming
Hi everyone,
Can anyone tell me how to take contents of a variable as a pattern for awk command. Am doing as below, but doesnt get any output:
$c = "Tue Dec";
$log = ` awk '/ \$c /' in.txt`;
print $log; (7 Replies)
Discussion started by: anandrec
7 Replies
5. Shell Programming and Scripting
what I'm trying to do is ... need to drop tables w/ names like
ABC_NY_2001
ABC_ORD_2001
ABC_TX_2001
ABC_CL_2001
For this, I want to write a query "DROP TABLE ABC_var_2001".
now "var" should be either NY, ORD, TX or CL.
I'm new to programming so don't know how to create a variable w/ OR... (3 Replies)
Discussion started by: ramsowji
3 Replies
6. Shell Programming and Scripting
Hi,
I'm trying to populate bash script variable, data_size with the
size of the largest file in my current directory
data_size=$(ls -lS | grep -v "total" | head -1) | awk '{ print $5 }'
I've tried adding an echo before the call to awk
data_size=$(ls -l | grep -v "total" | head -1) |... (2 Replies)
Discussion started by: mark_s_g
2 Replies
7. Shell Programming and Scripting
Dear all,
¿How can i insert a variable in a AWK pattern?
I have almost succeeded in solving a puzzle with AWK but now i want to make a script. Let me explain.
cat file.txt | awk 'BEGIN {RS="\\n\\n"} /tux/ { print "\n"$0 }'
I know that this command makes right what i want to do, but mi... (8 Replies)
Discussion started by: antuan
8 Replies
8. Shell Programming and Scripting
For a Script I need to detemine which field of the unix environment variable SHLIB_PATH has the
WALTDB entry.
export SHLIB_PATH=/usr/user5/WALTDB/oracle/product/10.2.0/lib32:/usr/TZD/bin.wdad/mug/oracle/lib:
echo $SHLIB_PATH | awk -F: '{ print $1 }'
Shure gives me the first entry, but... (6 Replies)
Discussion started by: sdohn
6 Replies
9. Shell Programming and Scripting
Hey there,
I have a table of contents file of the form
1 Title1
1.1 Subtitle1
1.1.1 Subsubtitle1
1.1.2 Subsubtitle2
...
and want to count the number of dots in the first field to find out the level of the section.
I use the gsub function for the job, which works if I pass the pattern... (2 Replies)
Discussion started by: herrsimon
2 Replies
10. Shell Programming and Scripting
Ok i have taken your advised indented my code and i have managed to fix my problem but unfortuantely now another small one has arisen.
The problem is that executing my commands requires two presses of the ENTER key as opposed to the originally being pressed once as one would expect, for example... (1 Reply)
Discussion started by: warlock129
1 Replies