Sponsored Content
Top Forums Shell Programming and Scripting C shell script passing arguments problem. Post 302989609 by drl on Monday 16th of January 2017 07:08:38 AM
Old 01-16-2017
Hi.

Apparently MadeInGermany did a better job of explaining csh / tcsh differences than I did on LinuxForums -- good work.

Observations:
  1. One should avoid csh-like shells for scripting: Csh Programming Considered Harmful in favor of Bourne-shell relatives: bash, ksh, zsh.
    .
  2. One may be able to replace source <file> <args> with ./<file> <args>
    .
  3. Not all Linux have csh as link to tcsh:
Code:
$ which csh tcsh
/bin/csh
/usr/bin/tcsh
$ ls -lH $( which csh tcsh )
-rwxr-xr-x 1 root root 143144 Jul 17  2014 /bin/csh*
-rwxr-xr-x 1 root root 395504 Sep  9  2014 /usr/bin/tcsh*

for a system like:
Code:
OS, ker|rel, machine: Linux, 3.16.0-4-amd64, x86_64
Distribution        : Debian 8.6 (jessie) 
csh - ( /bin/csh, 2016-02-04 )
tcsh 6.18.01

However, glad to see that there was a solution that suited the OP.

Best wishes ... cheers, drl

Last edited by rbatte1; 01-16-2017 at 08:12 AM.. Reason: Converted textual numbered list to formatted numbered list
This User Gave Thanks to drl For This Post:
 

10 More Discussions You Might Find Interesting

1. Solaris

Passing arguments to a shell script from file while scheduling in cron

Hi, I have a shell script Scp_1.sh for which I have to pass 2 arguments to run. I have another script Scp_2.sh which in turns calls script Scp_1.sh inside. How do I make Scp_1.sh script to read arguments automatically from a file, while running Scp_2.sh? -- Weblogic Support (4 Replies)
Discussion started by: weblogicsupport
4 Replies

2. Shell Programming and Scripting

passing runtime arguments to a shell script...

hi I am new to shell programming.....my question is while running one of my shell program it stops in between to accept input from the user and proceeds furthur after giving input....I want to know whether I can set this input through some files so that the shell acript reads the input from the... (10 Replies)
Discussion started by: santy
10 Replies

3. Shell Programming and Scripting

problem passing arguments to script

Hi, I am writing a script, which is invoked from other system using ssh. I have problems reading the arguments passing to the script. If the argument has a space in it (ex "rev 2.00"), the script considers "rev" as 1 argument and "2.00" as another. Instead i want "rev 2.00" to be considered... (5 Replies)
Discussion started by: cjjoy
5 Replies

4. Shell Programming and Scripting

Problem passing arguments to a Python script

I have part of the script below and I tried calling the script using ./tsimplex.py --fstmod=chris.cmod --nxz=8x6 --varp=0.25 but am getting the error option --fstmod must not have an argument Any idea on how to fix this would be highly appreciated #! /usr/bin/python import... (0 Replies)
Discussion started by: kristinu
0 Replies

5. Shell Programming and Scripting

Help required in passing multiple arguments from a shell script to a pl/sql block

Hi, hope everyone are fine. Please find my issue below, and I request your help in the same In a configuration file, i have a variable defined as below TEST = 'One','Two','Three' I am trying to pass this variable in to a sql script which is define in a pl/sql block as follows, In the... (1 Reply)
Discussion started by: ramakanth_burra
1 Replies

6. Shell Programming and Scripting

Passing arguments from a bash shell script to a command

I'm pretty new to bash scripting and I've found myself writing things like this (and the same with even more nesting): if $CATEGORIES; then if $LABEL_SLOTS; then $pyth "$wd/texify_grammar.py" "$input" "$texfile" "--label-slots" "--categories" "$CATEGORY_LIST" ... (9 Replies)
Discussion started by: burbly
9 Replies

7. Programming

Passing arguments from java to script shell

Hello Please i want to pass parameter (the string s) to the shell script: Quote: String s="Hello"; Process process = Runtime.getRuntime().exec("sh script1.sh"); How can i do please? Thank you (0 Replies)
Discussion started by: chercheur857
0 Replies

8. Shell Programming and Scripting

To run a local shell script in a remote machine by passing arguments to the local shell script

I need to run a local shell script on a remote machine. I am able to achieve that by executing the command > ssh -qtt user@host < test.sh However, when I try to pass arguments to test.sh it fails. Any pointers would be appreciated. (7 Replies)
Discussion started by: Sree10
7 Replies

9. Shell Programming and Scripting

Passing multiple arguments to a shell script

Hi Gurus, Need some help with the shell scripting here. #!/bin/ksh ps -ef | grep -i sample.ksh | grep -v grep > abc.txt if then echo "sample.ksh is executing" else echo "sample.ksh is not executing" fi (1 Reply)
Discussion started by: jayadanabalan
1 Replies

10. UNIX for Beginners Questions & Answers

Passing Arguments to shell script from file is not working as expected.

Hi All, I have below simple shell script in cloudera quick start vm cenos 6 which copy file from source to destination. # file_copy.sh source_dir = ${source_dir} target = ${target_dir} cp source_dir target and my parameter file is like below #parameter_file.txt source_dir =... (4 Replies)
Discussion started by: Narasimhasss
4 Replies
All times are GMT -4. The time now is 08:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy