LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 11-12-2009, 12:29 AM   #1
rahulruns
LQ Newbie
 
Registered: Feb 2008
Posts: 21

Rep: Reputation: 0
Variables in SHELL SCRIPT


Please let me know what the below script do

inquiry=${1:-./inq.linux}
outfile=${2:-./devices}
> $outfile


and

if [ -f /opt/emc/SYMCLI/*/bin/symcfg ]; then

what is the significance of * here

and

/opt/emc/SYMCLI/*/bin/symdev list pd | grep emcpower | egrep -v 'NR|WD' | awk '{ print $2 " " $NF }' > /tmp/test.log

do
 
Old 11-12-2009, 12:52 AM   #2
David the H.
Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 5,338

Rep: Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202Reputation: 1202
These are, for the most part, very basic scripting commands. The first is using parameter substitution to set a default value for the varibles, and > is a redirect to send something to the specified output file. This last line can't stand by itself though, as you posted it. There needs to be something in front of it to redirect first.

* is simply a (globbing) wildcard. It will match any string of characters.

The third is simply a string of commands linked together using | pipes. The output of one command is sent directly into the input of the next.

If you want to learn these things, start going through one of the many good online guides and tutorials. Here are a couple to start you with:

Linuxcommand.org
Bash Guide for Beginners

Last edited by David the H.; 11-12-2009 at 12:54 AM. Reason: some edits
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scope of shell script variables ? deepakc Linux - Newbie 4 07-07-2009 12:29 AM
Shell script variables Fredde87 Linux - Newbie 13 11-01-2006 03:35 AM
shell script variables Gary_Menegon Programming 1 10-02-2006 09:28 AM
Passing variables from AWK script to my shell script BigLarry Programming 1 06-12-2004 04:32 AM
Why?? can not use variables with shell script Bassam Linux - General 9 01-27-2004 07:42 AM


All times are GMT -5. The time now is 06:03 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration