Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: padmisri
4,412
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$"
3,504
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
...
3,504
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...
3,504
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...
3,504
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...
4,412
Posted By padmisri
Hi, what is "^sample$" ? am not able to...
Hi,

what is "^sample$" ? am not able to understand this.
4,412
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...
2,841
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,408
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...
3,595
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...
31,495
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...
31,495
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?
31,495
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,644
Posted By padmisri
Thanks for the reply
Thanks for the reply
2,644
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...
2,687
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,141
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...
15,901
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 "--"
15,901
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
3,801
Posted By padmisri
HI, Thanks.It worked. Regards, Padmini
HI,
Thanks.It worked.

Regards,
Padmini
3,801
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...
3,777
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,050
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,050
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,050
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

 

Featured Tech Videos

All times are GMT -4. The time now is 08:50 PM.
Unix & Linux Forums Content Copyright 1993-2021. All Rights Reserved.
Privacy Policy