I am new to schell scripting . My objective is to write a ksh shell script that performs following tasks: -
1. Script reads all command line arguments (arguments are file names) and checks if it contains charachters "abc" in it.
2. If it contains "abc" it will execute a binary file xyz <command line arguments>
Note: -
1. arguments can be from 1 to n.
2.
Hi friends you can solve my question about make 3 shell scripts?
Quote:
Write a shell script such that, given multiple files as arguments, showing, for each of them, his name and the number of lines it contains. Try it with any file.
2.
Hello please kindly solve these doubts i have about the following scripts
Code:
Script 1
//Shell script that accepts arguments and prints them in reverse order//
echo "number of arguments"
len=$#;
while [ $len -ne 0 ]
do
eval echo \$$len
len=`expr $len - 1`
done
---------
Output
$sh test.sh a b
b
a
1.what is \$$len.what is the significance of the escape sequence
Script 2
Cod
I want create a script with default arguments, of manner how some commands display default arguments pressing tab button in linux
In first instance I want to catch the tab button with the command trap, but it is not a correct way since the tab button shall trapped by the shell before to execute the script and no after
the questions are,
How catch the tab button in the shell before execute t
1. The problem statement, all variables and given/known data:
Problem 1:
I need to create a shell script the takes three arguments and echo's out "There once was a ____that____who like to_____"
The arguments go where the blanks are.
Problemt 2:
-Do an LS and store the listings in a file
-Open the file in emacs.
Hi All,
I want to pass few dynamic arguments to shell script. The number of arguments differ each time I call the script.
I want to print the arguments using the for loop as below. But not working out.
Code:
for (( i=1; i<=$#; i++ ))
do
echo $"($i)"
done
Code:
/bin/sh test.sh arg1 arg2 arg3
Any one please help.
Ok hope my vocab is right here, i'm trying to write multiple sets of arguments to another file for example:
I have a script that accepts four arguments and sends them to a another file
$write.sh it then out in
so the file receiver.txt would contain this:
Code:
it then out in
what do I need to do to execute another so it would do this
$write.sh dot spot got jot
Code:
it then out in
d
What my main is supposed to do is either read from stdin using system calls. Or if file arguments are given open the file arguments. I had already coded this to read from one file argument. But now I need it to open from multiple file arguments and I am short on the logic as to how to do this.
HI guys i am new to programing world, i have found one more wish with command line argument.
I have a shell script say one.sh ,
file_name=$1 //first argument file name(two.sh)
//connect to ftp and download $file_name
bash $file_name $2 $3 $4 //2nd 3rd and 4th arguments
say $file_name "actual name is two.sh, in two.sh
.....
.....
chmod 777 script.sh