I found something insteresting when I tested passing arguments into my scripts.
My scripts is as below.
When I test my scripts on Solaris 8. The results showed as following.
But when I tested it on RHEL 6.5 the results showed as below.
Ideally, the Linux results should be correct.
Unfortunately, I don't know how to check Solaris built-in csh version
I only found tcsh package info as below.
I kept wondering this should be a bug of Solaris 8 C-shell.
Does anybody have idea?
Except upgrading C-shell version, is there any workaround to solve this issue?
Thanks.
Last edited by rbatte1; 01-12-2017 at 07:38 AM..
Reason: Broke up the the scipts to seaparte block for clarity
is a tcsh extension.
In Linux, csh is a link to tcsh.
For consistent behavior you can change the shebang to
Hi,
Thank you for response.
Just as you said, when I change #!/bin/csh to #!/bin/tcsh, everything is fine.
It seems that if I change all scripts to executable (chmod 755) and replace
"source" command like passarg2.env "$str" the result is also correct.
Does it mean csh allow executable scripts to take arguments?
Last edited by rbatte1; 01-16-2017 at 08:10 AM..
Reason: Added ICODE tags
Yes, because an executable script is a command (just like all external executables).
While "source" shares shell variables, a command is completely separate.
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)