10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to check the condition of a variable before the script continues and it needs to match a specific pattern such as EPS-03-0 or PDF-02-1.
The first part is a 3 or 4 letter string followed by a hyphen, then a 01,02 or 03 followed by a hyphen then a 0 or a 1.
I know I could check for every... (4 Replies)
Discussion started by: stormcel
4 Replies
2. Shell Programming and Scripting
Hi all,
Is Perl included by default in Ubuntu? I'm trying to write a program using as few languages as possible, and since I'm using a few Perl one-liners to do non-greedy matching, it's considered another language, and this is a bad thing.
Basically, I'm using a Perl one-liner to grab XML... (3 Replies)
Discussion started by: Zel2008
3 Replies
3. Shell Programming and Scripting
I have a big perl script need to fix a small pattern matching inside ..
I have patterns like
create unique index
create index
The pattern matching should look for both the pattern in the same statement, The existing matching looks for only "create unique index"
The exising code for this i... (6 Replies)
Discussion started by: greenworld123
6 Replies
4. Shell Programming and Scripting
Hi All,
I have the following output file created as a result of one script called pattern_daily.log
$ cat pattern_daily.log
Approved|2|Wed, Oct 24, 2012 11:21:09 AM
Declined|1|Wed, Oct 24, 2012 11:21:15 AM
Approved|2|Wed, Oct 24, 2012 11:24:08 AM
Declined|1|Wed, Oct 24, 2012 11:24:18 AM... (4 Replies)
Discussion started by: Gem_In_I
4 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am trying to write a script that list down all the files that do not match the pattern
My pattern will be like this "*.jpg|*.xml|*.sql". This pattern will be stored in a file. The script need to read this pattern from the file and delete the files that does not match this pattern. It... (7 Replies)
Discussion started by: meenavin
7 Replies
6. Shell Programming and Scripting
Hi,
I am using following command to extract string from a file. String will be after last / (slash).
awk -F\ / '{print $NF}' $FILE
but while appending the output in file in script, it dosent work. File created but of zero size... can anyone please help
`awk -F\\\/ '{print $NF}' $FILE` >... (3 Replies)
Discussion started by: Deei
3 Replies
7. Shell Programming and Scripting
Hi,
I need to create a shell script through which i need to populate email addresses in email columns of database table in mysql. Let say if email contains yahoo, hotmail, gtalk than email addresses need to move in their respective columns.
# !/bin/sh
yim="example@yahoo.com"... (3 Replies)
Discussion started by: mirfan
3 Replies
8. Shell Programming and Scripting
I'm looking for a way to match a particular string in another string and if a match is found execute some command.
I found the case statement can be used like this;
case word in
)
command ;; ] ...
esac
If my string to find is say "foo" in the string $mystring... (1 Reply)
Discussion started by: paulobrad
1 Replies
9. Shell Programming and Scripting
i have 255 files in a directory named 000po.k thru 255po.k
and I want to copy all files except 3: exclude 000po.k, 166po.k,168po.k
I know the long way around it copying these files, but am looking for a shorter way of doing this:
my old approach:
# copy 001po.k thru 009po.k to target... (3 Replies)
Discussion started by: zoo591
3 Replies
10. UNIX for Dummies Questions & Answers
without using ls, just using echo so purely pattern matching
I can say echo */ <-- lists directories
but how would I match files? surely something like *!/ or * but neither work ?
it seems like there isn't much that I can put in but surely i should be able to put any ascii... (1 Reply)
Discussion started by: james hanley
1 Replies