Search Results

Search: Posts Made By: rtagarra
6,544
Posted By rtagarra
It worked . Thank You
It worked . Thank You
6,544
Posted By rtagarra
You mean to say like this : if [ "${ptype}" =...
You mean to say like this : if [ "${ptype}" = "sql" && [[ ! "$F" =~ \.sql$ ]]]; then

but this line also gives error

syntax error in conditional expression
syntax error near `;'
if [...
6,544
Posted By rtagarra
If statement Syntax error
Hi

Can you please tell me what is wrong with this line:

if [ [ "${x}" = "12" ] && [ ! "$F" =~ \.g$ ]]; then


basically i want to check if x = 12 and F (Filename) end with 'g'. But it...
3,102
Posted By rtagarra
Thank You !!!!
Thank You !!!!
3,102
Posted By rtagarra
One last question pls..i checked the regular...
One last question pls..i checked the regular expression link...but it does not say how to negate the operator =~, ie instead of looking for match if i want check if pattern is not matching "$F" =~...
3,102
Posted By rtagarra
Hi Bipin, Thanks for the reply. I am sorry...
Hi Bipin,

Thanks for the reply. I am sorry but i could not understand much in the code.

[[ "$line" =~ "=" ]] && ptype="${line%% *}"
(what the above line does)

...
3,102
Posted By rtagarra
Thanks a lot for your help..I got one off work on...
Thanks a lot for your help..I got one off work on Shell script and hence struggling..thansk a lot again and have a great day
3,102
Posted By rtagarra
I am sorry but may be i was not clear in my...
I am sorry but may be i was not clear in my requirement. The script you provided i think expects the file should contain only lines with "="..but my file may have some header section like comments to...
3,102
Posted By rtagarra
Thank You...This is what i was looking for. If...
Thank You...This is what i was looking for. If possible could you please confirm the following points:line[1] does it mean, "=" operator in my file has to be 2nd word in each line without any space.
3,102
Posted By rtagarra
that information will not come from...
that information will not come from anywhere...once i am able to extract the strings...then i need to write function which will check for validation...but in 1st place i dont know how to extract the...
3,102
Posted By rtagarra
Thanks for the reply. I am not sure if empty...
Thanks for the reply. I am not sure if empty lines will be completely empty, can we do one thing if that does not need any kind of assumption...I am fine closing the data in the end with ";", so is...
3,102
Posted By rtagarra
Hi Shamrock, Sincere aplogize for delay in...
Hi Shamrock,

Sincere aplogize for delay in response. Your solution is perfectly working fine. But the only issue being it gets me all the details in one go. let me again put my requirement....
3,102
Posted By rtagarra
Thanks a ton for the reply. Basically i want to...
Thanks a ton for the reply. Basically i want to have a shell script, which would read the file and do some validations, eg in below example if

Unix = abc def fgt jug
111 2222 3333

Linux =...
3,102
Posted By rtagarra
Finding Strings between 2 characters in a file
Hi All,

Assuming i have got a file test.dat which has contains as follows:

Unix = abc def fgt jug
111 2222 3333

Linux = gggg pppp qqq

C# = ccc ffff llll

I...
6,595
Posted By rtagarra
Thank You
Thank You
6,595
Posted By rtagarra
Thanks a lot for quick reply. I am sorry i could...
Thanks a lot for quick reply. I am sorry i could not understand much of the code:

while IFS="=" read v1 v2
do
[[ "$v1" =~ ^[[:alpha:]]+$ ]] && echo "String: \"$v1\" is valid" || echo...
3,639
Posted By rtagarra
String validation in shell script
Hi All,

I am a newbie...I would like to have a function which ll check if a file contains valid strings before "=" operator. Just to give you my requirement:
assume my file has content:

...
6,595
Posted By rtagarra
How to check if file contains valid strings?
Hi All,

I am a newbie...I would like to have a function which ll check if a file contains valid strings before "=" operator. Just to give you my requirement:
assume my file has content:

...
1,976
Posted By rtagarra
You are spot on brother...yes there is a function...
You are spot on brother...yes there is a function checkFile...Really thanks for the quick help....
1,976
Posted By rtagarra
Thanks for confirming...could you be kind enough...
Thanks for confirming...could you be kind enough to tell me what the condition is doing...i have no idea about shell script...i just need to understand this script..that is the problem

while [...
1,976
Posted By rtagarra
While condition in shell script
while [ "$driverName" = "" -o `checkFile "$driverName"` = "NOK" ]
do
if [ "$driverName" = "" ];then
read driverName
else
driverName=""
fi
done

can anyone please...
Showing results 1 to 21 of 21

 
All times are GMT -4. The time now is 09:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy