10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have one question in shell script for escape "\" with command substitution "` `". I post there to seek help to understand how it works.
My original one piece of code in script like this: This piece of code in whole script is working without errors
chk_mode=`sqlplus -s /nolog<<EOF
connect /... (4 Replies)
Discussion started by: duke0001
4 Replies
2. Shell Programming and Scripting
This is the script I already have but I have problems with two arguments
the first argument -t , I want to count 200 by the last digit of the IP address for example when I run the script ./ping.sh -t 17, the output would be192.168.0.217 is upThe second arguments --up won't work. Could anybody... (1 Reply)
Discussion started by: Roggy
1 Replies
3. Shell Programming and Scripting
Hello all!
I used to use expr for doing simple mathematics, but has a main advantage and a main disadvantage:
The advantage is that it can take variables for numbers
(e.g.{1}: echo "Give me first"
read lol
echo "Give other"
read lil
sum=`expr $lol + $lil`
echo "The sum of $lol and $lil =... (5 Replies)
Discussion started by: hakermania
5 Replies
4. UNIX for Dummies Questions & Answers
when I try to apply this principle to my script, is not working, it tells me something like 'command not found'
what i wrote is this..
if ;
then echo "message1";
else echo "message2"; fi
I'm supposed to count number of processes of the user, and if they're five or more, then a message... (2 Replies)
Discussion started by: aric87
2 Replies
5. Shell Programming and Scripting
I know there is a command called trap which can be used to capture the signals from a shell script and redirect the control to a required function (such as a cleanup).
My question is - Those of you who have written lot of shell scripts - do you always write a set of trap commands to capture... (4 Replies)
Discussion started by: sagar_evc
4 Replies
6. UNIX for Dummies Questions & Answers
Hi Everyone!
I'm trying to do simple math on a single command line instead of a script which I've already set up using let etc. I can not get the same output to display on a command line.
Essentially I would like a=20, b=50, and c=a*b.
When I tried:
let "A=20, B=50"; let C=A*B; echo $C
... (2 Replies)
Discussion started by: CasperQuiet
2 Replies
7. Shell Programming and Scripting
When i execute rm -f $1 via a script file named rmf, it is not deleting all the files, say starting with "sec". i have execute rmf for many times to remove all the occurrences...
$rmf sec* - this should delete all files starting with sec, but not.
The rm -f sec* is working fine. kindly help... (3 Replies)
Discussion started by: frozensmilz
3 Replies
8. Shell Programming and Scripting
I'm working on a 'find' command which uses the -exec option to tar a listing of files that it finds. Is there a single option available that would both 1) create the TAR file if it doesn't exist and/or 2) update the TAR file if it already exists?
Currently when I want manually create a TAR... (3 Replies)
Discussion started by: buechler66
3 Replies
9. Shell Programming and Scripting
Here is where I am at so far.....
-------------------------
#!/bin/bash
echo "Enter the output file name"
read output_file
echo "Enter the Orginal file Name"
read write_file
d= ' diff $write_file $output_file '
if $d = 1 ;then
echo "files are not identical"
else
echo "they... (2 Replies)
Discussion started by: tlfletcher05
2 Replies
10. UNIX for Dummies Questions & Answers
Hi I would like to run the diff command and recieve a little different output. I am on a linux machine. I am pretty new to shell scripting. So far my idea has shaped up to this, unworking, script. I would like file1: and file2: instead of the usual > or < output you recieve,
diff | sed -e ... (4 Replies)
Discussion started by: axcxe
4 Replies