10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
If i do below command in unix prompt which static values (ie 27..97), it is working fine and gives desired output
>ls -d $WORKDIR/batch/somefilename_{27..97}.* 2>/dev/null
somefilename_27.sometxt
somefilename_28.sometxt
somefilename_29.sometxt
..
somefilename_97.sometxt
But if i want... (2 Replies)
Discussion started by: haiderali
2 Replies
2. Shell Programming and Scripting
Hello ,
Could anyone help me to define the string in regular expression way .
Below is my string
\rtf1\ansi\deff0{\fonttbl{\f0\fswiss Helv;}{\f1\fnil MS Sans Serif;}}
{\colortbl ;\red0\green0\blue0;}
\viewkind4\uc1\pard\cf1\lang1033\f0\fs16
The string will always start as \rtf1 and... (6 Replies)
Discussion started by: Pratik4891
6 Replies
3. UNIX for Advanced & Expert Users
Hello All,
I'm trying to extract the lines between two consecutive elements of an array from a file.
My array looks like:
problem_arr=(PRS111 PRS213 PRS234)
j=0
while } ]
do
k=`expr $j + 1`
sed -n "/${problem_arr}/,/${problem_arr}/p" problemid.txt
---some operation goes... (11 Replies)
Discussion started by: InduInduIndu
11 Replies
4. UNIX for Dummies Questions & Answers
Hey every one!
I have a dataset like this :
1 100 1 0
5 100 1 8
7 50 1 0
7 100 2 0
10 20 1 8
10 30 1 8
10 100 3 8
15 50 5 0
20 90 1 0
20 99 9 0
I wanna check if the 4th column is 0 or 8
If it's zero write the 1st column itself, if it's 8 write sum of 1st and second
something... (2 Replies)
Discussion started by: @man
2 Replies
5. Programming
Hi all,
How am I read a file, find the match regular expression and overwrite to the same files.
open DESTINATION_FILE, "<tmptravl.dat" or die "tmptravl.dat";
open NEW_DESTINATION_FILE, ">new_tmptravl.dat" or die "new_tmptravl.dat";
while (<DESTINATION_FILE>)
{
# print... (1 Reply)
Discussion started by: jessy83
1 Replies
6. Shell Programming and Scripting
CA_RELEASE has a value of 6. I need to check if that this is a numeric value. if not error.
source $CA_VERSION_DATA
if * ]
then
echo "CA_RELESE $CA_RELEASE is invalid"
exit -1
fi
+ source /etc/ncgl/ca_version_data
++ CA_PRODUCT_ID=samxts
++ CA_RELEASE=6
++ CA_WEEK_NO=7
++... (3 Replies)
Discussion started by: ketkee1985
3 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I'm working on learning regular expressions and what I can do with them. I'm using unix to and its programs to experiment and learn what my limitations are with them.
I'm working on duplicating the regular expression:
^(.*)(\r?\n\1)+$
This is supposed to delete duplicate lines... (2 Replies)
Discussion started by: MykC
2 Replies
8. UNIX for Dummies Questions & Answers
I have the following code:
ls -al /bin | tr -s ' ' | grep 'x'
ls -al: Lists all the files in a given director such as /bin
tr -s ' ': removes additional spaces between characters so that there is only one space
grep 'x': match all "x" characters that are followed by a whitespace.
I was... (3 Replies)
Discussion started by: MykC
3 Replies
9. UNIX for Dummies Questions & Answers
ls -l generates something like...
-rwxr-xr-x 1 root root 19304 Jan 21 2009 true
-rwsr-xr-x 1 root root 40208 Jan 21 2009 umount
-rwxr-xr-x 1 root root 22336 Jan 21 2009 uname
-rwxr-xr-x 1 root root 1273 Jan 21 2009 unicode_start
-rwxr-xr-x 1 root root 79 Jan 21 2009... (3 Replies)
Discussion started by: MykC
3 Replies
10. UNIX for Dummies Questions & Answers
Hello,
This is my first post so, Hello World! Anyways, I'm learning how to use unix and its quickly become apparent that a strong foundation in regular expressions will make things easier. I'm not sure if my syntax is messing things up or my logic is messing things up.
ps -e | grep... (4 Replies)
Discussion started by: MykC
4 Replies