10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Experts,
I have been trying to work on a simple shell script that will just add the two argument passed to it. Here is what i tried :
#!/bin/bash
welcome(){
echo "Welcome to this Progg. which will accept two parameter"
}
main_logic(){
arg=$#
echo "Number of argument passed is... (4 Replies)
Discussion started by: mukulverma2408
4 Replies
2. How to Post in the The UNIX and Linux Forums
usage: myscript.sh config.json
config.json:
{
"HOST":"abc",
"DB_NM":"xyz",
"USR_NM":"asd",
"PWD":"xxx",
.........
.........
.........
........
}
myscript.sh: (2 Replies)
Discussion started by: RGRT
2 Replies
3. UNIX for Dummies Questions & Answers
I need to write a shell script, when I run that script I should pass those arguments if not, then script should not run and pass the error message like
invalid option - - should pass the argument.
and Exit from the script (8 Replies)
Discussion started by: Nsharma3006
8 Replies
4. Shell Programming and Scripting
I need to write a shell script, when I run that script I should pass those arguments if not, then script should not run and pass the error message like
invalid option - - should pass the argument.
and Exit from the script
https://www.unix.com/images/misc/progress.gif (1 Reply)
Discussion started by: Nsharma3006
1 Replies
5. Shell Programming and Scripting
I want to make a script that check for the argument passed to it and generates an error in case any character/string argument passed to it.
I am using below code, but its not working. can anyone help.
#!/bin/bash
if ]; then
echo 'An integer argument is passed to the script hence... (3 Replies)
Discussion started by: mukulverma2408
3 Replies
6. Shell Programming and Scripting
I want to make a script which takes the number of argument, add those argument and gives output to the user, but I am not getting through...
Script that i am using is below :
#!/bin/bash
sum=0
for i in $@
do
sum=$sum+$1
echo $sum
shift
done
I am executing the script as... (3 Replies)
Discussion started by: mukulverma2408
3 Replies
7. Shell Programming and Scripting
I have one working awk command line. Which taking data from the “J1202523.TXT” file and generating the “brazil.dat” file. PFB code.
awk '{ DUNS = substr($0,0,9);if ( substr($0,14,3) == "089" ) print DUNS }' J1202523.TXT > Brazil.dat
But now I want to pass two parameter as a command line argument... (4 Replies)
Discussion started by: humaemo
4 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have a very small requirement where i need to pass command output as an argument while invoking the shell script..
I need to call like this
sh testscript.sh ' ls -t Appl*and*abc* | head -n 1'
This will list one file name as ana argument..
I will be using "$1" in the shell... (2 Replies)
Discussion started by: pssandeep
2 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I am facing a problem to pass command line arguments that looks like
<script name> aa bb "cc" dd "ee"
I want to pass all 5 elements include the " (brackets). when I print the @ARGV the " disappear. I hope I explain myself
Regards,
Ziv (4 Replies)
Discussion started by: zivsegal
4 Replies
10. UNIX for Dummies Questions & Answers
i want to redirect output of one command as the command line argument of another script
for example, say i would run this command:
find . -xdev -type f -size +4096 -exec ls -al {} \;
i wan to be able to do something like:
echo +4096 | find . -xdev -type f -size ****** -exec... (3 Replies)
Discussion started by: IMTheNachoMan
3 Replies