Search Results

Search: Posts Made By: padmisri
5,036
Posted By padmisri
Hi, But am not getting the correct output...
Hi,

But am not getting the correct output if i use ls | grep "^sample$"
4,433
Posted By padmisri
Hi, Can someone help me in using awk or...
Hi,

Can someone help me in using awk or sed for finding out if the output contains a particular string.Because i cannot use * here in the for loop.

for example ,
if my output is
...
4,433
Posted By padmisri
Hi, Its SUSE linux . ----------...
Hi,

Its SUSE linux .

---------- Post updated at 10:05 PM ---------- Previous update was at 09:50 PM ----------

Hi,

if i use for loop , the input variable dosnt have the line by...
4,433
Posted By padmisri
Hi, i use echo $IS_VAR only. and the...
Hi,

i use echo $IS_VAR only.

and the example is slightly modified here

its like,
IS_VAR=0
ls | while read input
do
if [ $input = "hi" ]
then
IS_VAR=1
echo $IS_VAR
break
fi...
4,433
Posted By padmisri
Setting a variable within if block
Hi,

i have a variable which i would like to set inside an if block

for example
IS_VAR=0
if [ "true" = "true" ]
then
IS_VAR=1
fi
echo IS_VAR

the last echo statement gives 0.So...
5,036
Posted By padmisri
Hi, what is "^sample$" ? am not able to...
Hi,

what is "^sample$" ? am not able to understand this.
5,036
Posted By padmisri
how to find a particular string from a set of string output
Hi ,

I have a line by line output as follows,for example output of ls

sample1
sample2
sample

i need to check if this output contains the exact string sample.If i use grep , it will...
4,918
Posted By padmisri
using getopt for both short and long options
Hi ,

I am using getopt for both short and long options as below

SHORTOPTS="a:c"
LONGOPTS="alpha:,charlie"
OPTS=$(getopt -o $SHORTOPTS --longoptions $LONGOPTS -n "$progname" -- "$@")
eval...
4,768
Posted By padmisri
using getopt for both short and long options
Hi ,

I am using getopt for both short and long options as below

SHORTOPTS="a:c"
LONGOPTS="alpha:,charlie"
OPTS=$(getopt -o $SHORTOPTS --longoptions $LONGOPTS -n "$progname" -- "$@")
eval...
4,095
Posted By padmisri
using getopt for both short and long options
Hi ,

I am using getopt for both short and long options as below

SHORTOPTS="a:c"
LONGOPTS="alpha:,charlie"
OPTS=$(getopt -o $SHORTOPTS --longoptions $LONGOPTS -n "$progname" -- "$@")
eval...
36,215
Posted By padmisri
Thanks for the reply. ---------- Post...
Thanks for the reply.

---------- Post updated at 12:41 PM ---------- Previous update was at 12:24 PM ----------

Hi,
Depending on the above output, i need to assign the separated values to...
36,215
Posted By padmisri
Hi, Thanks for the reply.But in this case...
Hi,

Thanks for the reply.But in this case , i dont know the no of string values(for the above case it is 3 but actual case it is not fixed) i will be getting.How can i handle that?
36,215
Posted By padmisri
Extracting the values separated by comma
Hi,


I have a variable which has a list of string separated by comma.

for ex ,

Variable=/usr/bin,/usr/smrshbin,/tmp

How can i get the values between the commas separately using...
2,915
Posted By padmisri
Thanks for the reply
Thanks for the reply
2,915
Posted By padmisri
Writing to standard error
Hi,

I want to redirect the standard output to standard error whenever an error occurs for ex
if [ a -eq 0 ]
then
echo right
else
echo wrong
fi

I want to redirect the wrong to...
3,034
Posted By padmisri
how to run a command as root
Hi,

i need to run a command as root.Whoever executes the command ,i will check for a particular role if that is satisfied i have to make it to run as root.

Please help me to carry out this....
2,771
Posted By padmisri
--alternative option in getopt
Hi,

i need to use --alternative option of getopt

for ex . getopt -o a:c: --alternative pw: -- "$@"

if i use like this, i am not getting any output.Please help me how to correct this.i...
19,046
Posted By padmisri
yes but am actually accessing the arguments with...
yes but am actually accessing the arguments with the arg variable in a for loop.so how can i compare the value of the arg variable with "--"
19,046
Posted By padmisri
How to compare a command line parameter with -- in shell scripting
Hi,

I need to check if a parameter provided at the command line is equal to --.How can i do that ? Please help me.


Thanks and Regards,
Padmini
4,176
Posted By padmisri
HI, Thanks.It worked. Regards, Padmini
HI,
Thanks.It worked.

Regards,
Padmini
4,176
Posted By padmisri
Error in setting PATH variable in bash shell
Hi,

I am new to shell scripting.I tried adding an entry to the path variable like below

export PATH=$PATH:/opt/xxx/bin
But am getting an error invalid identifier /opt/xxx/bin

Can someone...
4,012
Posted By padmisri
How to check if a word begins with "-"
Hi,

I need to find the words that begin with a "-" letter .How can i do this in shell scripting? I tried using grep '[-]*'.But it is not working.Can i have a way of doing this?

Thanks in...
27,406
Posted By padmisri
Thanks for the replies.Using getopts am facing a...
Thanks for the replies.Using getopts am facing a problem.for ex, if i have a command
listcert -t -k keystore -p password -l label.My optstring is tp:k:l: OPTIONS since t doesnt have any argument....
27,406
Posted By padmisri
how can i use long options with -l option in...
how can i use long options with -l option in getopt.Please give me an example.
27,406
Posted By padmisri
Hi, I am new to shell scripting.what it...
Hi,

I am new to shell scripting.what it means using while with $@?what is the significance of $@?
Showing results 1 to 25 of 26

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