10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Dear forum members,
I want the script to count ALA as one (an example in quotes) and return an integer as 1 and not return 5 as an integer as it does now (look bash script). So how can I upgrade my script that it first checks or after finding all instances of ALA checks whether it is the same... (25 Replies)
Discussion started by: Aurimas
25 Replies
2. UNIX for Dummies Questions & Answers
I created a file with the permissions of 776.
When I ran the command find /root/Desktop -perm -644 -type f
The created file shows up as part of the results.
Doesn't -perm -mode mean that for global, only 4(read) and 2(write) can be accepted ? (2 Replies)
Discussion started by: Hijanoqu
2 Replies
3. Shell Programming and Scripting
I need to develop a script where I will take two date arguments as parameter date1 and date2 which will in format YYYYMM.
Below is the input file say sample.txt.
sample.txt will have certain blocks starting with P1.
Each block will have a value 118,1:TIMESTAMP.
I need to compare the... (7 Replies)
Discussion started by: garvit184
7 Replies
4. Shell Programming and Scripting
Can someone please explain the strange behaviour.. I was just trying a few things to learn awk..
in the below code when I start the braces in the same line, the output is as expected, when I start at next line, output is displayed twice.
Please see the file, code I tried and output below.
... (2 Replies)
Discussion started by: Kulasekar
2 Replies
5. Shell Programming and Scripting
Imagine 2 files f1 f2:
file1_l1_c1 code_to_find file1_l1_c3
file1_l2_c1 file1_code2 file1_l2_c3
file1_l3_c1 file1_code3 file1_l3_c3
file2_l1_c1 file2_l1_c2 code_to_find
file2_l2_c1 file2_l2_c2 file2_code5
file2_l3_c1 file2_l3_c2 file2_code3
Say we want to print lines from f2 having... (5 Replies)
Discussion started by: ripat
5 Replies
6. Shell Programming and Scripting
Hi,
I have following codes which looks ok:
$ string1="123456789 abc2"
$ string2="abc"
$ position_of_string2=`expr index "$string1" "$string2"`
$ echo $position_of_string2
$
11however, when string2="abc2", it gives me the following result:
$ string1="123456789 abc2"
$... (5 Replies)
Discussion started by: littlewenwen
5 Replies
7. Shell Programming and Scripting
I've written a script:
find -depth | awk ‘
{
if ( substr($1,length($0)-2,3) == “/1.” )
{ print $1 }
{ system(“awk -f test1.awk “ $1 ) }
}
‘
The idea is that it trundles through a large directory structure looking for files which are named '1.' and then... (3 Replies)
Discussion started by: nashcom
3 Replies
8. Shell Programming and Scripting
Hi all,
some small script with eval turned me to crazy.
my OS is linux
Linux s10-1310 2.6.16.53-0.8.PTF.434477.3.TDC.0-smp #1 SMP Fri Aug 31 06:07:27 PDT 2007 x86_64 x86_64 x86_64 GNU/Linux
below script works well
#!/bin/bash
eval ssh remotehost date
eval ssh remotehost ls
below... (1 Reply)
Discussion started by: summer_cherry
1 Replies
9. Shell Programming and Scripting
So, I'm making a little awk script that generates a range-based histogram of a set of numbers. I've stumbled onto a strange thing. Toward the end of the process, I have this test:
if ( bindex < s )
"bindex" is the "index" of my "bin" (the array element that gets incremented whenever a... (2 Replies)
Discussion started by: treesloth
2 Replies
10. Shell Programming and Scripting
hii every one can anybody help me writing shell script with this,
i have a file ...
amit
arun
vivek
and i want to read something from the user and print next to amit or arun in certain column.. like
amit 23-wall street 2000
arun 34343
vivek 4758
is... (6 Replies)
Discussion started by: kumar_amit
6 Replies