LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-05-2012, 03:51 AM   #1
linuxquestions_alex
LQ Newbie
 
Registered: Oct 2011
Posts: 3

Rep: Reputation: Disabled
A script source problem


Hi,

File A.csh
#! /bin/csh -f
Code:
...
...
source B.csh arg1 arg2
...
...
File B.csh
Code:
#! /bin/csh -f
...
...
if ($argv[1]...
if ($argv[2]...
...
...
Sourcing A.csh results error " source: Too many arguments."
How to avoid this?
Thanks.
 
Old 04-05-2012, 07:15 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,442

Rep: Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774Reputation: 2774
some c shell variants do not allow arguments for source.
you can do something like this:
Code:
...
set c = ("a" "b" "c")
source B.csh
and in B.csh:
Code:
...
if ($c[1] ...
if ($c[2] ...
...
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Source or Execute an external Script from shell script helptonewbie Linux - Newbie 2 08-11-2010 12:48 PM
Bash script problem with ftp session exiting the script early edomingox Programming 5 02-23-2010 05:39 AM
using source inside a shell script DEF. Programming 8 11-18-2009 05:52 PM
Installer script source spydrmn Slackware 2 11-22-2006 12:31 PM
Getting the Source of a CGI Script kdepa Linux - Security 5 04-30-2004 07:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration