04-15-2010
I tried if then...but the problem is when I read variable..let's say use give variable b as the option he want, but the file that I want to open with that do not open.
Now I am thing of delclaring varibale as numbers and then compare with if..then and try to open..
I will let you know if that workks
Thanks for reply though
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am missing something here, I have a file which contains only one line and that is either a number or character string. I am trying to read the file and assign that value to a variable and here it seems I am missing something and not getting the expected results... Here is the code :
#!/bin/ksh... (2 Replies)
Discussion started by: Vaddadi
2 Replies
2. UNIX for Dummies Questions & Answers
HI
I have something like this in a file
ABC = 1
DEF = 2
GHI = 3
JKL = 4
MNO = 5
QRS = 6
TUV = 7
I need to assign ABC to V_abc (that is to a variable)
GHI to V_ghi (that is to another variable)
TUV to say V_tuv
... (6 Replies)
Discussion started by: ssuresh1999
6 Replies
3. Shell Programming and Scripting
I was trying to store the number of lines in a file and store it in a file.after that i want to store the information in a file to a variable which is further used in the if loop to check certain condition.
#!/bin/bash
cat <file> | wc -l > count.txt
x="$count.txt";
i=10;
if ; then
cat... (10 Replies)
Discussion started by: sudhakaryadav
10 Replies
4. Shell Programming and Scripting
i get a name from user first name : last name, in this format. Now i am saving this to a file. what i want is, I do not want to save any name if I already have one entry o that same name..what should i do
for example
user give robert fernandez
this will save in file as robert:fernandez.
if... (5 Replies)
Discussion started by: Learnerabc
5 Replies
5. Shell Programming and Scripting
Hi All,
I am trying to read a .csv file which has some 6 columns.
Eg: samp.csv
one, two, three, four
six, seven, eight, nine
I used the following code,
for line in `cat samp.csv`
do
echo "$line"
done
It displays every comma seperated values in each line like,
one,... (1 Reply)
Discussion started by: johnwilliams.sp
1 Replies
6. Shell Programming and Scripting
Hi Gurus,
I have a file named log with 2 lines
Each line is a file name. eg
$ cat log
monday
tuesday
I need to read log and assign each output(filename) to a different variable.
The following doesn't work:-
while read A B
do
echo " a is ${A} "
echo " b is ${B} "
done <... (6 Replies)
Discussion started by: wisdom
6 Replies
7. Shell Programming and Scripting
I have a file that has four values on each line and I'd like to give each column a variable name and then use those values in each step of a loop. In bash, I believe you could use a while loop to do this or possibly a cat command, but I am super new to programming and I'm having trouble decoding... (2 Replies)
Discussion started by: ccorder22
2 Replies
8. Shell Programming and Scripting
I wrote a simply perl that searched a file for a particualr value and if it found it, rite it and the next three lines to a file. Now I have been asked to check those next three lines for a different value and only write those lines if it finds the second value.
I was thinking the best way to... (1 Reply)
Discussion started by: billprice13
1 Replies
9. Shell Programming and Scripting
I am in the process of creating a BASH shell scripts for a project at work. So the scenario is as such:
I have a file with each line entry separated by ':'
... (3 Replies)
Discussion started by: metallica1973
3 Replies
10. Shell Programming and Scripting
Hello, I have a file in the following format
id sample platform R1 R2 gene1 gene2 gene3
1 abc llumina R1_001.fastq.gz R2_001.fastq.gz apoe prnpp asp
2 def llumina R1_001.fastq.gz R2_001.fastq.gz apoe prnpp
3 ghi llumina ... (3 Replies)
Discussion started by: nans
3 Replies
LEARN ABOUT SUNOS
gnome-open
gnome-open(1) User Commands gnome-open(1)
NAME
gnome-open - open a file using the appropriate application
SYNOPSIS
gnome-open [-h] filename
DESCRIPTION
gnome-open opens a file from the command line by launching the appropriate application that is associated with the file mime type.
OPTIONS
The following options are supported:
-h Display usage and help information.
OPERANDS
The following operands are supported:
filename Specifies the name of the file to open.
EXAMPLES
Example 1: Opening a Text File in the Home Directory
example% gnome-open README.txt
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables: NLSPATH.
EXIT STATUS
The exit value 0 is returned regardless of success or failure.
FILES
The following files are used by this application:
/usr/bin/gnome-open Executable to open a file using the appropriate application
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWgnome-libs |
+-----------------------------+-----------------------------+
|Interface stability |External |
+-----------------------------+-----------------------------+
SEE ALSO
Latest version of the GNOME Desktop User Guide for your platform.
NOTES
Written by Stephen Browne, Sun Microsystems Inc., 2004.
SunOS 5.10 6 Sep 2004 gnome-open(1)