Search Results

Search: Posts Made By: MarkZWEERS
4,042
Posted By MarkZWEERS
nested 'if' statement
Once more a very beginners question: what is wrong in my second 'if' statement?

# my shell arguments
NB_ARGS=$#
ARGS=$@
echo arguments\: $ARGS; echo

# inspect arguments
if [[ $# -lt 3 && $#...
4,225
Posted By MarkZWEERS
I've asked a question about the '.' prefix in...
I've asked a question about the '.' prefix in this thread:

https://www.unix.com/shell-programming-scripting/72689-control-sub-shells-2.html#post302213109

thanks a lot!
3,943
Posted By MarkZWEERS
Ok, then I think my mind needs a little refresh...
Ok, then I think my mind needs a little refresh on the '.' (see also https://www.unix.com/shell-programming-scripting/72714-argument-hysteresis-2.html ).

I've always learned to run scripts with a...
4,225
Posted By MarkZWEERS
Haha no this is not a joke, but I really just...
Haha no this is not a joke, but I really just make my first steps in shell scripting, and I think forums are very helpful. So I was just playing with 'for' loops, '$#', '$@' ... I just copied some...
4,225
Posted By MarkZWEERS
Yes, it does do the same thing on my system...
Yes, it does do the same thing on my system (Debian Etch).

This is the entire script:

#!/bin/ksh
#
# try-outs for script arguments from command line
#

echo You\'ve typed $# arguments,...
4,225
Posted By MarkZWEERS
that's a copy-paste error... I'll try the...
that's a copy-paste error...
I'll try the script at home on my linux machine as well. Thanks anyways!
4,225
Posted By MarkZWEERS
here it is, my file "arguments_try.ksh": ...
here it is, my file "arguments_try.ksh":


#!/bin/ksh
# my shell arguments
NB_ARG=$#
ARGS=$@
echo nb arguments\: $NB_ARGS; echo
echo arguments\: $ARGS; echo

commands in the terminal:
...
4,225
Posted By MarkZWEERS
argument hysteresis?
Hi there,

When I try to execute the following simple script "simple_cript.ksh":

NB_ARG=$#
ARGS=$@

the number of arguments and the arguments themselves seem to be remembered. If I run it a...
3,943
Posted By MarkZWEERS
:-) But that's the problem, I don't have the...
:-) But that's the problem, I don't have the contents of that shell. At least I cannot modify it.

To compile my source code for a platform, I normally launch a shell from the command line, which...
3,943
Posted By MarkZWEERS
Thanks for the answer, but it is not exactly what...
Thanks for the answer, but it is not exactly what I am trying to do.

One can put commands in a shell script, like 'ls' or 'touch', or one can launch a program. Now I'll launch a shell in the...
3,943
Posted By MarkZWEERS
control sub-shells
Hi all,

New to shell scripting, I would like to know if it is possible to pass commands to a shell, which has been launched by a parent shell.
Example:


#!/bin/ksh
#
# Launch and command...
Showing results 1 to 11 of 11

 
All times are GMT -4. The time now is 03:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy