10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Is there a special positional variables for when using the dot (.)?
Scripts are as below:
$: head -100 x.ksh /tmp/y.ksh
==> x.ksh <==
. /tmp/y.ksh 1234 abcd
echo "yvar1 = $yvar1"
echo "yvar2 = $yvar2"
==> /tmp/y.ksh <==
#!/bin/ksh (2 Replies)
Discussion started by: newbie_01
2. UNIX for Beginners Questions & Answers
Based on arguments passing in command prompt values should fetch and store in new file.
sh test.sh 10 30 35 45
cut -c $1-$2,$3-$4 file_name >> file_new
Above sample passing 4 arguments.. but it may differ (sh test.sh 10 30 35 45 70 75 ) based on... (1 Reply)
Discussion started by: Jairaj
I haven't programed in C in a few years. I have been doing a lot of shell scripting, I.E. not really programming anything heavy. :o
That said, I have a script that gives hourly usage statistics for our email server. It runs w-a-y to slow as a script for my impatience, and needs to... (7 Replies)
Discussion started by: mph
4. Shell Programming and Scripting
I have an for loop that reads the following file
The for loop extracts the each line of the file so that at any one point, the value of i is
I would like to extract each... (19 Replies)
Discussion started by: goddevil
5. UNIX for Dummies Questions & Answers
I have a few aliases set up on AIX servers in my .kshrc file. Some of them contain multiple commands that are piped together.
A simple example would be something like this:
# alias to list directory contents as root and sort by size.
alias lss='sudo ls -l | sort -nbk5'
When I call... (5 Replies)
Discussion started by: derndingle
6. UNIX for Dummies Questions & Answers
I need to pass arguments to a shell script.My batch is calling some java program.
java -classpath program
if first parameter and second parameter is null then
java -classpath program
if first parameter is not null and second parameter is... (3 Replies)
Discussion started by: mnjx
7. Shell Programming and Scripting
I have a shell script "Test.ksh" and I need to pass 8 parameters/arguments while executing the script
./Test.ksh 1 2 3 4 5 6 7 8
Out of these I want first 3 to be compulsory and rest 5 to be optional. Can you suggest the way to do this like and also how to pass these optional... (3 Replies)
Discussion started by: indrajit_u
8. Shell Programming and Scripting
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
9. Shell Programming and Scripting
I have a script to which I pass multiple arguments, for example lets say the script name is "abc". I run the script like
./abc def /file <directory location>
In the above "def" is the first argument and "/file" is the second argument. I expect <directory location> that is passed after... (4 Replies)
Discussion started by: zmfcat1
10. Shell Programming and Scripting
i am passing around 14 parameters for a script
still for j it is displaying the 1st parameter value..how to make it take the 10th parameter (2 Replies)
Discussion started by: dnat