Research questions


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Research questions
# 8  
Old 06-04-2014
1. FILE[2]=file1.txt; which means instead of saying print file1.txt, you say print FILE[2] is this correct?
# 9  
Old 06-04-2014
FILE[2]=file1.txt Looks very much like giving a value to a variable.. But its indexed... like tables/arrays? ...
so
Code:
[ ! -f "${FILE[$CNTR]}" ]

[ -f ... ] is a condition matching if you look at shells manuals e.g. bash or sh you would find -f being a boolean Conditionnal expression for : if the specified file exist... I let you search what ! could be, if you replace $CNTR by its value, what do you see?
# 10  
Old 06-05-2014
Code:
 "FILE[2]=file1.txt;
 CNTR=2;
 if [ ! -f "${FILE[$CNTR]}" ];
 then 
    echo yes; 
 else 
    echo no;
 fi"

---------- Post updated at 03:37 PM ---------- Previous update was at 03:34 PM ----------

This command checks if the file exists anywhere on the server. If it does, it will display “yes” if it doesn’t it will display “no”

Last edited by vbe; 06-05-2014 at 10:48 AM.. Reason: Not sure how to use the code tag
# 11  
Old 06-05-2014
You havent been looking for !
You would have found thats its a boolean operator inverting a true condition to false and vice versa...
please use code tags for code and data! Code should be between the tags

You dont know neither do I, where it is searching because the given code doesnt specify... so most like current directory...

Some reading:
Unix - Using Shell Variables
This User Gave Thanks to vbe For This Post:
# 12  
Old 06-05-2014
Zakl

In order to use code tags, highlight the text you want to wrap in code tags when posting, and select the button on the formatting bar which is labeled code (with co on the top line and de on the bottom line), with a white background.
# 13  
Old 08-03-2014
Quote:
Originally Posted by vbe
Not knowing unix is one thing, applying for a IT job having a single idea of what IT basic programming is is another...

2) someone from WIN* cannot guess so I would say catenate file1.txt and output only first and last line...
But if you are asked to explain, what will you answer?
1) Have you tried to figure out? with a litle programming knowledge you should be able to guess right...
2) Catenate file1.txt and delete first and last line.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

NAS Research

Good Afternoon, Are most NASs compatible with Solaris/RedHat? Specifically, I'm looking at Western Digital ones but none of them say they are - I like My Cloud Pro Series PR4100 My Cloud Pro Series PR4100 – Network Attached Storage | Western Digital (WD) (3 Replies)
Discussion started by: Stellaman1977
3 Replies

2. UNIX for Advanced & Expert Users

Research ID - in Crontab

Hi, I have a unix script which runs a process (informatica workflow). To trigger this workflow an entry is made into the crontab and it is scheduled to run. Issue: The crontab entry is commented out. But the process is running in the unix box and it was scheduled immediately. There is someone... (6 Replies)
Discussion started by: diva_thilak
6 Replies

3. UNIX for Dummies Questions & Answers

Research an expression in VI editor

Hi, how to look for an expression like : or Client ChkAeStatus4 service in VI ? For a word , of cours : /word (2 Replies)
Discussion started by: big123456
2 Replies

4. Homework & Coursework Questions

Print questions from a questions folder in a sequential order

1.) I am to write scripts that will be phasetest folder in the home directory. 2.) The folder should have a set-up,phase and display files I have written a small script which i used to check for the existing users and their password. What I need help with: I have a set of questions in a... (19 Replies)
Discussion started by: moraks007
19 Replies

5. UNIX for Dummies Questions & Answers

research proposal for PG

hi friends i have just completed my graduation and applied for Post graduation i have to submit a research proposal of OS in the interview i m a beginner & only read galvin & silbershcatz book on operating systems can anyone help me in that ... thanks in advance (3 Replies)
Discussion started by: iet.manish
3 Replies

6. Windows & DOS: Issues & Discussions

Research for College

I am researching the reasons why Unix / Linux is the chosen operating system versus Windows. I have had difficutly narrowing down resources. I am wondering if anyone has any favorite sources that they would care to share. Thanks Dan (2 Replies)
Discussion started by: isenhart
2 Replies

7. UNIX for Dummies Questions & Answers

Research paper

I am doing a "research" paper for school and i'm having a hard time finding accurate information. I am supposed to choose three differant versions of unix, give a brief explination of each, tell why there each differant from each other. I have found a ton of web sites but the information is so vast... (1 Reply)
Discussion started by: pantsusan
1 Replies

8. Forum Support Area for Unregistered Users & Account Problems

Research Project

Hi, I need you help with my research project that attempts to determine the link between users and manufacturers of IT Products such as Unix. This is part of an MBA program that I'm currently pursuing. My challenge is that I cannot possibly find out how I can send my research... (1 Reply)
Discussion started by: Tdludlu
1 Replies
Login or Register to Ask a Question