10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I'm stuck on a particular problem and need some guidance. I have a file with a name and a phone number in it (teledir.txt). I need to do a $# in a separate script to take a positional parameter and check to see if it is in the file. To quote the question:
If one argument is supplied, check... (6 Replies)
Discussion started by: Eric7giants
6 Replies
2. Shell Programming and Scripting
Hello,
I have a question regarding the usage statement of a script.
I have 2 parameters "--pto" and "--pto_list". To start the script I will need one of them. Both together are not possible.
How this would be printed out within a usage statement?
My suggestion would be:
Usage:... (4 Replies)
Discussion started by: API
4 Replies
3. Shell Programming and Scripting
hi Scripting experts, I am using case..esac in my script .. I have given 6 option..e.g. 1 2 3 4 5 and *, howerver my script works welll for 1st 4 options but for 5 it considers * and exists. Is there a maximum limit on number of options given for case ..esac? (1 Reply)
Discussion started by: sdgawande
1 Replies
4. Programming
Hi
Am pretty new to C..
Am trying to pass the arguments from command line and use them in switch case statement..
i have tried the following
#include <stdlib.h>
main(int argc, char* argv)
{
int num=0;
if ( argc == 2 )
num = argv;
printf("%d is the num value",num);
switch ( num )
... (2 Replies)
Discussion started by: Priya Amaresh
2 Replies
5. Shell Programming and Scripting
Hi,
I'm using the bourn shell on a Sun Solaris Unix system. I am relatively new to UNIX scripting so please bear with me...
I'm having a couple issues:
1) I need to have a variable $FSIZE set with the output of a command each time the script runs. (the command looks for a file and... (8 Replies)
Discussion started by: dqrgk0
8 Replies
6. Shell Programming and Scripting
Hi... can anyone please help me out in using the CASE and command line argument in shell script... i am bit new to shell scripting...below i have explained my proble with example...
say i have an executable file with name 'new1.sh' and there are 3 functions in it a(), b() and c()....and there... (5 Replies)
Discussion started by: swap21783
5 Replies
7. Shell Programming and Scripting
Hi
I would like to use tar cmd in my script.
I have a variable with filenames, e.g. 1000 records and I would like to paste its values into tar cmd.
For this example I used three elements variable strings.
strings="file1.txt file2.txt file3.txt"
`tar cf file1.tar $strings`
Whether... (1 Reply)
Discussion started by: presul
1 Replies
8. Shell Programming and Scripting
I am writing a script to pull diskspace information from our servers. Here is the script that I wrote:
#!/bin/ksh
for host in `cat /oper/hosts/esc.misc`
do
ssh -q -o ConnectTimeout=10 operator@$host df -h|grep "/dev/" |egrep '8%|9%|100%' | awk '{print H " " "at " $5 " with " $4 "... (1 Reply)
Discussion started by: rkruck
1 Replies
9. UNIX for Dummies Questions & Answers
I want to write a program with the following variables:
a=7000
b=24000
c=613.8
The user can enter two words: Vivid or Blue for example. The challenge is that the user might not want to write the words the way they appear. The user can write V or v or vivid or Vivid or write Blue or blue, or B,... (1 Reply)
Discussion started by: Ernst
1 Replies
10. Shell Programming and Scripting
I am new to shell, and I am trying to do a if statement like the following:
if ; then
basically it works fine if both arguments of the if are met, however the next elif is:
elif ; then
if the conditions of the elif are met, then it says "final1.sh: line 67: [: too many arguments"
... (6 Replies)
Discussion started by: Darklight
6 Replies