05-16-2008
if statment, based on retune value
hello
im working on a project for the iphone to write a termainal based program
we have bsd subsystem installed so have access to most unix command
i have a executable called coordinates, which get the coordinates of the iphone
when this runs it returns to the terminal the text of "success" or the text of "failed"
i want to write a shell script that will run different code for each, somthing like
if (result of coordinates = "success") then
{chunk of code1}
else
{chunk of code2}
end if
anyone got any ideas that could help?
thanks.
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
hi 2 all,
I'm trying 2 print " ' " in an awk statement but the sign deosn't show.
The only way I came with is 2 declare the ' as a variable and call that variable.
I'm trying 2 do:
awk '{printf("insert into ba_memo_01 values ('%s');",$1)}'
and get the output:
insert into ba_memo_01 values... (7 Replies)
Discussion started by: baraka
7 Replies
2. Shell Programming and Scripting
I am looking to find something in the hour(in field $2) of 03:00:07 and 04:00:07 and 05:00:07 and must contain something in field 4... why doesn't below command work?
I try to use grep .. but since I am running this in loop, it's best I use the awk ..
can someone please advise.. I am pretty... (1 Reply)
Discussion started by: hankooknara
1 Replies
3. UNIX for Dummies Questions & Answers
In DOS you can call a section of code multiple times by using the Call Statment I.E.
Call :Test1
:Test1
If My_Name = Yourname
then My_name > Name.txt
Can this be done in a Unix Script? (21 Replies)
Discussion started by: jadionne
21 Replies
4. UNIX for Dummies Questions & Answers
Can someone tell me what exactaly the following command is doing -
pid_cmd="/usr/ucb/ps -axww | /usr/bin/egrep '${SUNMC2OSS_PATH}/SunMC2OSS\.jar.* sunmc2oss\.SunMC2OSS\$' | /usr/bin/egrep -v egrep | /usr/bin/nawk '{print \$1}'"
Is the egrep is to check "sunmc2oss.SunMC2OSS" process inside... (2 Replies)
Discussion started by: puneet1983
2 Replies
5. UNIX for Dummies Questions & Answers
I need to validate the special characters of a date (the characters between the year and month & month and day). The data filed is being populated by users and read into the script vi an argument. I want to ensure that the date is a '-' (dash) and not a '/' or '\' (slash).
The every thing I... (3 Replies)
Discussion started by: angelap
3 Replies
6. Shell Programming and Scripting
Please let me know if I can use -F option and - V in a single awk statment. I want to import some comma separated shell variables using -F option and defining some static variables inside awk using -v option. (2 Replies)
Discussion started by: kalee
2 Replies
7. Shell Programming and Scripting
Hello everyone
I was hoping someone could tell me whether I can use a wildcard inside an tcsh if statement.
I am trying to test the argument the user has fed the script and whether it is a .txt file.
The Ides behind it is the following
if (`echo $1` != *.txt) then
echo "wrong... (6 Replies)
Discussion started by: smarones
6 Replies
8. UNIX for Dummies Questions & Answers
Hi admin,
I have two files which is on row and many columns ( both are identical), I need to add both the files with two columns and many row.
I have opted the solution in the following way.
awk '{ for (i=1;i<=NF;i++) { print $i;}}' tmp1 > tmp
mv tmp tmp1
awk '{ for (i=1;i<=NF;i++) {... (3 Replies)
Discussion started by: senthil.ak
3 Replies
9. Shell Programming and Scripting
I am fairly new to writing scripts, and have gotten a lot of help from this site in the past with many of the posts.
I have a question/issue with a script I am attempting to write and have a question regarding executing an sql statement inside of a loop (do while). I have in the past written... (1 Reply)
Discussion started by: josbor01
1 Replies
10. Shell Programming and Scripting
Hello,
im creating a csv file for email reporting on issues.
my problem is that after 'continue' command in if statment in a loop
the new paramter writing into the log doesnt take new line.
timeout 4s zabbix_get -I $ZBX -p $PORT -s $IP -k "system.run"
if ; then
... (3 Replies)
Discussion started by: batchenr
3 Replies
LEARN ABOUT CENTOS
mvn_artifact
MVN_ARTIFACT(7) Java Packages Tools MVN_ARTIFACT(7)
NAME
mvn_artifact - request installation of Maven artifact
SYNOPSIS
%mvn_artifact model [artifact-file] %mvn_artifact artifact-coordinates artifact-file
DESCRIPTION
mvn_artifact macro marks specified Maven artifact to be installed by further call to mvn_install. Multiple calls to mvn_artifact and/or
mvn_build can be made to request installation of multiple artifacts.
OPERANDS
model
Path to raw project object model (POM) file to be associated and installed with artifact.
artifact-file
Path to file to be used as artifact file. If omitted then no artifact file is installed.
artifact-coordinates
Artifact coordinates specify artifact to be installed. If specified then no model file is installed with artifact. Coordinates are in
format groupId:artifactId[:extension[:classifier]]:version. If extension is omitted then "jar" is used. If classifier is omitted then
empty classifier is used. For more information see XMvn Configuration Reference.
AUTHOR
Written by Michal Srb.
REPORTING BUGS
Bugs should be reported through Red Hat Bugzilla at http://bugzilla.redhat.com/.
SEE ALSO
mvn_build(7), mvn_install(7).
JAVAPACKAGES
06/10/2014 MVN_ARTIFACT(7)