LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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, 04: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, 08:15 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,776

Rep: Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888Reputation: 2888
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 01:48 PM
Bash script problem with ftp session exiting the script early edomingox Programming 5 02-23-2010 06:39 AM
using source inside a shell script DEF. Programming 8 11-18-2009 06:52 PM
Installer script source spydrmn Slackware 2 11-22-2006 01:31 PM
Getting the Source of a CGI Script kdepa Linux - Security 5 04-30-2004 08:37 PM

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

All times are GMT -5. The time now is 12:55 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