"var" is going to start with arg1 and get reassigned to the next in the list each iteration until argn
"T1" is always going to be arg1
"T2" is always going to be arg2
How can I use a variable that has the conditions for the if statement stored in it?
my test script
condition=" || || "
if "$condition"
then echo "true"
else echo "false"
fi
output
$ ./test2.sh
./test2.sh: line 3: || || : command not found
false (2 Replies)
Hi All,
I am trying to check if two variables have value assigned to it.
i am doing it like
if ]
then
echo "Please specify either single hostname or host file for the report"
usage
exit
fi
But its not working for it.Even i specify values for both variables it dont go... (6 Replies)
Hi, I have meaning to include an if condition statement in my code to check the directory for existing output files and if its existing i want the program to delete it before doing the succeeding command. i just dont know the correct syntax for it. thanks much guys, this forum has indeed been very... (4 Replies)
Urgent help with bash scripting
1- i am using grep to find a string called: tinker panic 0 in a file /etc/ntp.conf
if the string is not there, i want to add the strings in /etc/ntp.conf file in the first line of the file. if not do nothing or exit.
2- also i want to add # in front of the... (2 Replies)
I want to check (using bash condition test function) if string contains three spaces, ignoring last three spaces at the end of string.
string_to_report='foo bar foo bar '
string_to_ignore='foo bar ' (8 Replies)
In the below I can not seem to add a line that will add Not low if the statement in bold is not true or meet. I guess when the first if statement is true/meet then print low, otherwise print Not low in $(NF + 1). I am not sure how to correctly add this. Thank you :).
if(low <= $2 && $2 <=... (5 Replies)
Hi,
I need to perform the untar and rm operation if the file found is a .tar and does not have test.tar or hello.tar as the file names.
Below is the loop to check the same.
for tf in *.tar
do if ]
then found=1
... (1 Reply)
I wrote a code to find codons in a DNA string. The only problem I have is how do I make the code only work for a file with DNA. This means the file only has the characters a,c,g,t and no white space characters. (3 Replies)
Hi.
I wrote this small bash script, i want to compare second column from file1 with file2 if a pattern matches. Files are small and I am sure that pattern occurs only once. I think this can be rewritten into a awk one liner. Appreciate if someone could give me idea. Whole NR FNR confuse me :o
... (6 Replies)
Discussion started by: ctrld
6 Replies
LEARN ABOUT DEBIAN
shevek_ristring
shevek::ristring(3) Library Functions Manual shevek::ristring(3)NAME
shevek::ristring -
shevek::ristring is identical to shevek::istring, but it uses std::string instead of Glib::ustring.
SYNOPSIS
#include <iostring.hh>
Public Member Functions
ristring ()
Create a new istring with no data.
ristring (std::string const &str)
Create a new istring with data.
void init (std::string const &str)
Set new data to an existing istring.
void push ()
Push the current position to the stack so it can be restored later.
int pop (bool keep=false)
Pop the last pushed position from the stack.
void reset ()
Set the current position to 0, but don't change the stack.
std::string rest () const
Get remaining string.
void skip (std::string::size_type p)
Skip some characters.
bool operator() (std::string const &format)
Read a constant string from the input.
template<typename T1 > bool operator() (std::string const &format, T1 &arg1)
Read a string containing one argument from the input.
template<typename T1 , typename T2 > bool operator() (std::string const &format, T1 &arg1, T2 &arg2)
Read a string containing two arguments from the input.
template<typename T1 , typename T2 , typename T3 > bool operator() (std::string const &format, T1 &arg1, T2 &arg2, T3 &arg3)
Read a string containing three arguments from the input.
template<typename T1 , typename T2 , typename T3 , typename T4 > bool operator() (std::string const &format, T1 &arg1, T2 &arg2, T3 &arg3,
T4 &arg4)
Read a string containing four arguments from the input.
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 > bool operator() (std::string const &format, T1 &arg1, T2
&arg2, T3 &arg3, T4 &arg4, T5 &arg5)
Read a string containing five arguments from the input.
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 > bool operator() (std::string const &format, T1
&arg1, T2 &arg2, T3 &arg3, T4 &arg4, T5 &arg5, T6 &arg6)
Read a string containing six arguments from the input.
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 > bool operator() (std::string
const &format, T1 &arg1, T2 &arg2, T3 &arg3, T4 &arg4, T5 &arg5, T6 &arg6, T7 &arg7)
Read a string containing seven arguments from the input.
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 > bool operator()
(std::string const &format, T1 &arg1, T2 &arg2, T3 &arg3, T4 &arg4, T5 &arg5, T6 &arg6, T7 &arg7, T8 &arg8)
Read a string containing eight arguments from the input.
Static Public Member Functions
template<typename T > static T direct (std::string const &data, std::string const &format, T def=T())
Read a variable from given data and return it.
Detailed Description
shevek::ristring is identical to shevek::istring, but it uses std::string instead of Glib::ustring.
Member Function Documentation
template<typename T > static T shevek::ristring::direct (std::string const &data, std::string const &format, Tdef = T ()) [inline, static]
Read a variable from given data and return it. This allows using a shevek::istring in an expression without the need to create a new
variable for it. If the input doesn't match the format, def is returned.
int shevek::ristring::pop (boolkeep = false)
Pop the last pushed position from the stack. If keep is true or not given, the current position is restored to the last position. If it is
false, the current position is not changed.
Author
Generated automatically by Doxygen for libshevek from the source code.
libshevek Fri May 11 2012 shevek::ristring(3)