Hi all,
I'm having problems with the setting a variable in a nested if statement. It doesn't seem to change even if it mets the 'if' condition.
My script essentially looks for a user name from the output from a kerberos command.
When I find the user name, I tried to change a variable and exit... (6 Replies)
#!/bin/sh
APP_ROOT_MODE1=/opt/app1.0
APP_ROOT_MODE2=/opt/app2.0
APP_ROOT=${APP_ROOT_${APP_MODE}}
# enviornment variable APP_MODE will be exported in the terminal where
# we run the applciation, its value is string - MODE1 or MODE2
# My intension is:
# when export APP_MODE=MODE1... (4 Replies)
I have a question about nested double quotes. Any help is appreciated.
Here are my commands on Mac OS.
# string="Ethernet \"USB Ethernet\" \"Bluetooth DUN\" AirPort FireWire \"Bluetooth PAN\""
# echo $string
Ethernet "USB Ethernet" "Bluetooth DUN" AirPort FireWire "Bluetooth PAN"
#... (3 Replies)
Hi I have a requirement to create a 2 folder based on there existance
if
then
cd $var_name
if
then
cd $var_name3
mv -fi *.* $var_TargetPath/$var_name/$var_name3
else
mkdir -p "$var_name3"
chmod 755 "$var_name3"
mv -fi *.* $var_TargetPath/$var_name/$var_name3
else
mkdir... (7 Replies)
Hi,
I want to parse nested variable in my script.
for exp-
c=1
G1='0318'
G2='0023'
G3='3092'
G4='0014'
while ;do
g=G$c
a=$g
echo "Group=$g and value=$a"
c=`expr $c + 1`
done
final output are as -
---------------------------
Group=G1 and... (4 Replies)
Hi friends,
I'm having a bit of a problem using shell variable in an awk if statement.
Please note that i'm using -v option as listed in many forums but I still don't get it working. Here's my code. Kindly help as I've gone crazy trying to work this out :wall:
#!/bin/bash -xv
... (4 Replies)
Hello experts,
I'm stuck with this script for three days now. Here's what i need.
I need to split a large delimited (,) file into 2 files based on the value present in the last field.
Samp: Something.csv
bca,adc,asdf,123,12C
bca,adc,asdf,123,13C
def,adc,asdf,123,12A
I need this split... (6 Replies)
I've made a number of errors with this and am trying to work a solution within the same framework.
/bin/ksh
for host_name in ahost1 ahost2 bhost1 bhost2
do
for host_prefix in a b
do
if echo ${host_name} | grep -qi ${host_prefix}
then
if
... (1 Reply)
Hi,
I'm trying to automate part of a script which uses awk to grab out some lines of a log file based on certain fields matching. For example, my log file looks something like the following (but 1000s of lines):
1 Tom 123 abc 345
2 Dick 345 abc 678
3 Harry 567 abc 345
4 Tom 345 cde 345... (3 Replies)
In the awk below I am trying to add a | that will adjust $2 in the ouput by adding +1 if the original value from file that was used in $3 had a - in it. Line 3 of file is an example of this. In my current awk I just subtract one but I am not sure how to only apply this to those values without a -.... (5 Replies)