10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
i need a equivalent for the statement i run in bash, so it would also run in other shells. Specially i need it for ksh to run on AIX.
Here the statements:
exec > >(tee -a $log)
exec 2> >(tee -a $log >&2)
Thanks. (5 Replies)
Discussion started by: Kosak
5 Replies
2. Shell Programming and Scripting
I have the following code in bash, however "set red frmt" is not displayed.
echo "iarg_rd = $iarg_rd"
iarg_rd="2"
if ; then
echo "Hello World"
fi
if ; then
frmt="${gap}${!frmt_titl_yl}"
elif ; then
frmt="${gap}${!frmt_titl_bk}"
elif ; then
echo... (2 Replies)
Discussion started by: kristinu
2 Replies
3. Shell Programming and Scripting
Hi Gurus,
I have the below BASH code which does not works for upper case alphabets except Z (upper case Z).
What may be the reason. Also escape sequences like \n, \t, \b, \033(1m \033(0m (For bold letter) are not working.
case $var in
)
echo "Lower case alphabet"
;;
... (7 Replies)
Discussion started by: GaneshAnanth
7 Replies
4. UNIX for Dummies Questions & Answers
Hey guys,
Currently trying to write a wee script that runs only when logged in as one of two users. The rest of the script is working fine, but no matter what user I try to run it as, it always fails! This is the puzzling part:if ]; then
echo "Run script as admin "
exit 1
else... (6 Replies)
Discussion started by: jimbob01
6 Replies
5. Shell Programming and Scripting
if ]; then
echo "successssssssssssssssssss"
$filename = "<font color='red'>$i</font>"
else
echo "failureeeeeeeeeeeeeeeeeeeee"
$filename = "$i"
fi;
I'm just trying to see is this - read a file name and highlight... (2 Replies)
Discussion started by: vmanda
2 Replies
6. UNIX for Dummies Questions & Answers
I want to combine 2 conditional statements by using -o in bash, but it won't work.
if ; then
echo "The number needs to be between 0 and $nr"
fi
Each time i execute the file it says:
./selectCitaat: line 10: syntax error near unexpected token `$1' (3 Replies)
Discussion started by: doc.arne
3 Replies
7. Shell Programming and Scripting
Greetings, I attempting to create a line statement that will do the following:
1. Read the input file
2. Extract lines containing certain keep words
3. Print the lines in a tabular format (CSV)
Help is what I have so far:
# cat text.tx | egrep -i -e "(Check Name) | (Risk Level) |... (6 Replies)
Discussion started by: jroberson
6 Replies
8. Shell Programming and Scripting
Hi,
I am trying to create a script just to study BASH scripting, but I have some problems.
I need to create a script that gets a filename as an argument. The script should behave as follows:
• If the given file name already exists, inform the user and quit.
• If the given file name does... (2 Replies)
Discussion started by: I-1
2 Replies
9. Shell Programming and Scripting
Hi,
I have a script as below:
.......................................................................
rpttxt()
{
name="$*"
awk '/'"${name}"'/ {print $2$3$4 }' file_1.txt
}
title="`rpttxt "TITLE"`"
.........................................................................
The... (0 Replies)
Discussion started by: jisha
0 Replies
10. Shell Programming and Scripting
Hi all,
I have a script which gets its input from a text file (file.txt) and processes each line within a loop.
I have a counter which increases by one and I want something to happen every 7th, 14th, 21st, etc. line read.
Currently the code looks and works perfectly like this:
... (3 Replies)
Discussion started by: candyflip2000
3 Replies