9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to figure out how many times a location (columns 1 and 2) is present within a group of files. I figured using a combination of 'while read' and 'grep' I could count the number of instances but its not working for me.
cat file.txt | while read line
do
grep $line *08-new.txt | wc -l... (6 Replies)
Discussion started by: ncwxpanther
6 Replies
2. Shell Programming and Scripting
data.txt
{
"auth_type": "role",
"default_attributes": {
"sudoers": {
i need to know how manyspaces are before an actual character in each line of a file.
for example. in the above data.txt,
There are 0 spaces leading up to {
There are 4 spaces leading up to the... (7 Replies)
Discussion started by: SkySmart
7 Replies
3. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
Develop a shell script that accepts a phrase and counts the number of times that it is repeated in a specific website.
Note: Im not sure if it's the whole website, or just a specific page but im guessing its thewhole website.
... (2 Replies)
Discussion started by: Zakerii
2 Replies
4. Shell Programming and Scripting
hi,
Is it possible to print a particular character n number of times in a line?
for example.
i am print the following line using echo command..
echo "files successfully moved"
i want to count the number of characters that are been displayed. i am doin it using
echo "files... (8 Replies)
Discussion started by: Little
8 Replies
5. Shell Programming and Scripting
i should use this script runs how many times before ?
how can i do_? (3 Replies)
Discussion started by: utoptas
3 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have the following data in a flat file:
abcd_efgh_ijkl_20080522.dat|20080602222508|1357
abcd_efgh_ijkl_20080522.dat|20080602222508|1357
abcd_efgh_ijkl_20080522.dat|20080602222508|1357
I need to check the no. of occurence of "|" (pipe) on each line and the output should look like below:... (4 Replies)
Discussion started by: hey_mak
4 Replies
7. UNIX for Advanced & Expert Users
Hi All,
I have a file of the format :
idsfskjvfdznvdfjvh
ierwjfkncmvlkmc
xszkmdvnosndzjndf
weuhrndzierfncv
rndsjnsllshens
iernzkfndslkdhf
zkinewfinfvlkmvd
I wish to count the occurrences of character 'z' in the file.
I also need to find out the position of 'z' in various lines.
and... (3 Replies)
Discussion started by: rochitsharma
3 Replies
8. Shell Programming and Scripting
Hi,
I need to count the number of times a script is accessed from within the script. Is it possible ?
Example: I have a script called lo.sh and i execute the script for the first time, then the counter variable declared inside the lo.sh should increment by 1. For every execution the... (1 Reply)
Discussion started by: pathanjalireddy
1 Replies
9. Shell Programming and Scripting
How can I print a '-' on the same line within awk, say 50 times, without actually typing '-' 50 times?
Cheers (3 Replies)
Discussion started by: dbrundrett
3 Replies