10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,
I'm running into a very weird situation. Let's forget about the purpose of my initial script please. I noticed the bug whatever I'm trying to do.
I'm on an old server running bash 3.1.17.
Say we have the following script :
foo:~# cat /tmp/test
#!/bin/bash
f1() {
local... (9 Replies)
Discussion started by: chebarbudo
9 Replies
2. Homework & Coursework Questions
Hi All,
As per my knowledge in unix, my code looks fine. But still I am getting error (expr:syntax error). Please help me to resolve this error.
Script :
PRE_LBNO=0
PRE_DATE=0
TOT_PAY=0
TOT_REM=0
TOTAL=1
for Record_Type in `cut -c 1 Inputt.dat`
do
if ;
then
CURR_LBNO=` cut -c... (6 Replies)
Discussion started by: lathanandhini
6 Replies
3. UNIX for Advanced & Expert Users
Hi,
I'm trying to sort a text file "test":
S12
S_S12
S_S1_12
S15
S_N15
S_N1_15
By "sort test", I get:
S12
S15
S_N1_15
S_N15
S_S1_12
S_S12
It seems weird:
Comparing Line 2 and Line 3, it must be that '-' is bigger than '1'; however, comparing Line 3 and Line 4, it seems that... (3 Replies)
Discussion started by: intermilan
3 Replies
4. UNIX for Advanced & Expert Users
I've posted about this before, but only recently narrowed the problem down to a specific cause.
Ok, first of all, the behavior:
It occurs when autocompletion brings up its list (not when there is only a single option). Basically, if I were to type, say,
cd ~/<TAB>
I would get something... (2 Replies)
Discussion started by: marshaul
2 Replies
5. Shell Programming and Scripting
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Discussion started by: shis100
7 Replies
6. Shell Programming and Scripting
Is it normal behavior for a shell script that terminates to terminate its parent shell when executed with the "." option?
For example, if I have the example script (we'll name it ex.sh):
#!/bin/sh
if
then
echo "Bye."
exit 2
fi
And I execute it like this:
>./ex.sh
It... (6 Replies)
Discussion started by: DreamWarrior
6 Replies
7. Shell Programming and Scripting
Hi Guys,
THis is the first time am using the expr expression.
I like to know how to write the expression a=(b\100)*a.
THis works fine if it gives without a bracket. the bracket should be present as i wanted to define the order of execution.
Help me out.
Thanks for your help in advance.... (2 Replies)
Discussion started by: mac4rfree
2 Replies
8. Shell Programming and Scripting
I know I asked a similar question but I want to know if there is a regular expression existing that with a korn shell cmd, finds any timestamp data records in a file where it is greater then a timestamp in a shell variable ?
something like :
grep all records where it has a timestamp >... (5 Replies)
Discussion started by: Browser_ice
5 Replies
9. Shell Programming and Scripting
I found below script to check whether the variable is a digit in ksh.
############################
#!/bin/ksh
REPLY="3f"
if ]*\)'` != ${REPLY} && "${REPLY}" != "0" ]]
then
print "is digit\n"
else
print "not digit\n"
fi
############################
Although it works fine, but... (6 Replies)
Discussion started by: sleepy_11
6 Replies
10. Shell Programming and Scripting
Hi,
I came across a script a few months ago that allowed you to use the following script to include the current time into your prompt (useful from auditting purposes):
# Set Prompt
typeset -RZ2 _x1 _x2 _x3
let SECONDS=$(date '+3600*%H+60*%M+%S')... (5 Replies)
Discussion started by: m223464
5 Replies