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 and shell scripting languages here.

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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-09-2008
felipebb felipebb is offline
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
  #2 (permalink)  
Old 06-09-2008
felipebb felipebb is offline
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 04:40 PM..
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0