10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi, I have collection of letters in a column such as:
AA5678
AA9873434
..
..
I am trying to find the number of charecters in each.
"echo "AA5678"|wc -c
7----------------> why does it give 7 instead of 6? (6 Replies)
Discussion started by: kvosu
6 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a question, during my readings it appears that these two variables in the snippet below need to be on the same line to return a “true” answer and listed in the output otherwise it won’t be returned. How can I write this snippet to make it return a “true” if those two variables are on... (6 Replies)
Discussion started by: bdby
6 Replies
3. Shell Programming and Scripting
Its really 2 questions, but both are pretty basic.
Linux Redhat
1. Need to do a search and replace on a file.
I need to append '--' (comment out the line) to specific lines based on a wildcard search.
So if I Have
GRANT SOME_ROLE_OR_USER ...
I dont care what comes after that.... (2 Replies)
Discussion started by: guessingo
2 Replies
4. Shell Programming and Scripting
Hi, i have a a bunch of directories that are always named with six lowercase alpha's and either one or two numeric's (but no more)
so for example names could be
qwerty1
qwerty9
qwerty10
qwerty67
I am currently using two pattern matches to capture these names
echo $DIR |... (8 Replies)
Discussion started by: rethink
8 Replies
5. Shell Programming and Scripting
I want to egrep for certain fields which are not existing in the current log files and am getting errors for that...
egrep "'^20090220.14'|'^20090220.15'|'^20090220.16'|'^20090220.17'|'^20090220.18'"
Some of the times are in future and logs don't have those entries and I get errors for them... (1 Reply)
Discussion started by: jacki
1 Replies
6. Shell Programming and Scripting
hi all here is a very simple question.. i want to count the number of columns using awk..my file looks like this:
1,2
1,2
1,2
1,2
1,2
1,2
1,2
1,2
i want to count number of columns and i so far i have:
awk 'BEGIN {IFS=","} END {print NF}' data > data1
i am getting 1... (3 Replies)
Discussion started by: npatwardhan
3 Replies
7. UNIX for Dummies Questions & Answers
I have a script that does the following. It searches a listing of directories with specific extensions and then formats a wc on those files. The code looks like this
find <directory> -name '*.js' -o -name '*.html' | awk '{print \"wc -l \"$1}' > file \n"
The result is a file with the "wc -l"... (7 Replies)
Discussion started by: mastachef
7 Replies
8. UNIX for Dummies Questions & Answers
Hi I've been searching google and have not found what egrep -c means. Does anyone know where I can get a cheat sheet or what that -c means?
thanks,
Linda (2 Replies)
Discussion started by: leelm
2 Replies
9. UNIX for Dummies Questions & Answers
Hi
I am trying to use this command:
egrep '^a{2,6}$' testexpr4D
to retreive lines with 2,3,4,5, or 6 a's in a file .
The file testexpr4D has entries like:
a
aa
aaa
aaaa
aaaaa
aaaaaa
123456
ABCDEF
I was expecting to see 5 lines in the output but nothing happens.
Can anyone help... (10 Replies)
Discussion started by: rohitv
10 Replies
10. Shell Programming and Scripting
This will likely be a simple one for you gurus!
I have the following line:
xcount=`ls -1p $process_dir | grep -v '\/' | grep -c "$"`
xcount ends up being a count of the files in the directory represented by process_dir. So if I have 10 files in there like test.dat, test.rpt, etc. it... (1 Reply)
Discussion started by: gerard1
1 Replies