The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sed , Replace a "variable text" inside of a statement jackn7 Shell Programming and Scripting 4 03-04-2008 11:40 AM
Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" Lokesha UNIX for Dummies Questions & Answers 4 12-19-2007 09:52 PM
error "Invalid argument" returned after call sched_setscheduler robin.zhu High Level Programming 1 07-26-2007 12:51 AM
Returning a "0" if folder is empty Raynon Shell Programming and Scripting 12 06-01-2007 02:59 AM
"test: argument expected" error mvalonso UNIX for Dummies Questions & Answers 6 02-09-2005 10:07 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-09-2008
Registered User
 

Join Date: Jun 2008
Posts: 2
Unhappy Argument ${1} returning "dev" [newbie inside]

I'm trying to build a korn shell script which will check some information located at a column of one .csv archive.

The problem I'm having is that my script is not having the correct response:

Code:
#!/bin/ksh

i = 1

echo "Printing 1"
echo "${1}"
echo "Printing #"
echo "${#i}"
echo "Printing @"
echo "${@}"
echo "Printing *"
echo "${*}"
Running: script.ksh a b c

The response:

ksh[3]: i: not found
Printing 1
dev
Printing #
0
Printing @
dev
Printing *
dev

"dev" I believe that it's regarding the environment I'm working on, but it was supposed to retrieve:

Printing 1
a
Printing #
3
Printing @
a
Printing *
abc

Thanks for anyone who helps.

Best regards,

Felipe
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-09-2008
Registered User
 

Join Date: Jun 2008
Posts: 2
Unhappy

Guys, The problem is kind of solved, I've got the info that I needed to run "chmod -x <script_name>" in order to the whole thing happen, so the script could be really executed.

There are still a few flaws I need to amend.

I'm trying to search some way to access arguments variables as arrays, obtaining the $1 or $5 as something like array[1].

Thanks in advance for any help that might come.


Cheers!

Last edited by felipebb; 06-09-2008 at 12:40 PM.
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:27 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0