I'm new to unix and the command line and am trying to learn different commands. I have a file (teledir.txt) that contains a name and phone number for 3 different people. I am writing a script that is to take two positional parameters and I typed out how it should behave:
I declared two variables: name=$1 and number=$2. But I'm lost on what command to use in the script to see if the name and/or number exists in the other file.
Hi All,
Has been a while since I was last on, so I hope everyone has been doing fine. ;)
Would like to know if the below IF statement syntax is correct for a ksh environment. It's been pushed into live as someone had deleted the development copy(!); not withstanding that, the statement now... (3 Replies)
Hi,
Can you please help me with this one: I write an "if" statement, something like this:
if
then
echo "big file"
else
echo "normal file"
and I get an error: `'then is not expected
Thanks in advance (6 Replies)
Hi, can someone please tell me what is wrong with this code? I just want it to check if the file size is greater than 2000kb.
if
Thanks!
---------- Post updated at 09:23 PM ---------- Previous update was at 09:21 PM ----------
I should probably post the full code:
#!/bin/sh... (9 Replies)
I'm working on a function in a shell script I'm writing that will eventually take in and print out a list of vendor names and aliases (for my work) Here's the function in question:
addvendorandalias ()
{
echo
echo -n 'Would you like to create a new vendor list (y or n)? '
read answer... (3 Replies)
It saves me lot of typing and space/lines when I do not use full 'if' keyword and construct, instead use ..
&& <statement> || <statement>
that perfectly replaces..
if ; then
<statement>
else
<statement>
fi
Can I use following syntax when I want to add multiple statements under 'if'... (4 Replies)
Hi,
Is there a way to compare the value in if condition with a list of values.
eg . if ]
then
echo "it's a mammal"
else
echo "its not"
fi
Thanks! (8 Replies)
Hi
Can you please tell me what is wrong with this line:
if && ]; then
basically i want to check if x = 12 and F (Filename) end with 'g'. But it is throwing syntax error. (7 Replies)
I am getting the following error when I am running a script in ksh when trying to execute an if statement comparing two numerical values
tstmb.sh: 1.5321e+08: 0403-057 Syntax error
Below is my code snippet.
#!/bin/ksh
set -x
TODAY=$(date +%y%m%d)
for file in $(ls -rt *.log | tail... (11 Replies)
I want to make the file test condition a variable ($Prmshn in code below).
My goal is to use something like the first three unsuccessful if statetments since the 'if
#!/bin/ksh
test_input()
{
Prmshn=${1}
InFLNm=${2}
ifReq="-$Prmshn $InFLNm"
#the following three if statments fail:
#if ] ;... (10 Replies)
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
LEARN ABOUT DEBIAN
rdf::redland::statement
RDF::Redland::Statement(3pm) User Contributed Perl Documentation RDF::Redland::Statement(3pm)NAME
RDF::Redland::Statement - Redland RDF Statement Class
SYNOPSIS
use RDF::Redland;
my $statement1=new RDF::Redland::Statement($statement);
my $statement2=new RDF::Redland::Statement($subject,$predicate,$object);
...
if($statement->subject->equals($node)) {
...
}
DESCRIPTION
Manipulate RDF statements which comprise three RDF::Redland::Node objects. Also used for partial statements which can have empty parts and
are used for matching statements in statement queries of the model - see the RDF::Redland::Model.
CONSTRUCTORS
new NODE NODE NODE|STATEMENT
Create a new statement from nodes or copy an existing statement.
If three NODEs are given, make a new statement from them. Each Node can be a Redland::RDF:Node, a Redland::RDF::URI, a perl URI or a
string literal. Otherwise STATEMENT must be an existing statement to copy.
clone
Copy a RDF::Redland::Statement.
METHODS
subject [SUBJECT]
Get/set the statement subject. When a RDF::Redland::Node SUBJECT is given, sets the subject of the statement, otherwise returns a
reference to the statement RDF::Redland::Node subject.
predicate [PREDICATE]
Get/set the statement predicate. When RDF::Redland::Node PREDICATE is given, sets the predicate of the statement, otherwise returns a
reference to the statement RDF::Redland::Node predicate.
object [OBJECT]
Get/set the statement object. When RDF::Redland::Node OBJECT is given, sets the object of the statement, otherwise returns a reference
to the statement RDF::Redland::Node object.
as_string
Return the statement formatted as a string (UTF-8 encoded).
equals STATEMENT
Return non zero if this statement is equal to STATEMENT
OLD METHODS
new_from_nodes SUBJECT PREDICATE OBJECT
Create a new RDF::Redland::Statement with the given RDF::Redland::Node objects as parts (or undef when empty for a partial statement).
Use instead:
$a=new RDF::Redland::Statement($subject, $predicate, $object);
new_from_statement STATEMENT
Create a new RDF::Redland::Statement object from RDF::Redland::Statement STATEMENT (copy constructor). Use instead:
$s=$old_statement->clone;
SEE ALSO
RDF::Redland::Node
AUTHOR
Dave Beckett - http://www.dajobe.org/
perl v5.14.2 2011-02-04 RDF::Redland::Statement(3pm)