I need help in what to do with a bash script? I'm trying to run a command to output the data from a table and then insert it into commands. Looping for each row of data.
For example the output data from a table:
10 John house
20 Jane apt
30 Joe townhomeThen I need to take the output... (1 Reply)
If I run this command
networksetup -listallnetworkservices
I get the following output.
Ethernet
AirPort
*Parallels Host-Guest
*Parallels NAT
MY VPN
Ethernet 2
I want to make changes to only anything that contains the word "Ethernet" which I can do with grep.
But What I really need a... (6 Replies)
hi,
I have to reverse the command output like below:
output:
online
offline
disable
maintening
killed
How to reverse this output like:
killed
maintening
disable
offline
online
It should be ksh script. (4 Replies)
Hi Guys,
This is based on my question previously posted. :)
I have my shell script like this:
#!/usr/bin/sh
e_id=`sqlplus -s scott/tiger@DB<<eof
SET PAGESIZE 0 FEEDBACK OFF VERIFY OFF HEADING OFF ECHO OFF;
select emp_id from employee;
quit
... (1 Reply)
All,
Here is my for loop
export CFGLIST="LIST1 LIST2 LIST3"
for i in $CFGLIST
do
echo print $i
done
The output will be
LIST1
LIST2
LIST3
But i want it display
LIST3
LIST2
LIST1 (8 Replies)
:wall:Hi
I am a beginner to unix
In a shell script i see the below code
# set admin email so that you can get email
ADMIN=someone@somewhere.com
host=`hostname`
date=`date`
# set alert level 70% is default
ALERT=70
df -h | grep / | grep -v '^Filesystem|tmpfs|cdrom' | awk '{ print... (1 Reply)
Hi ,
I'm writing the for loop script in home directory and wanted to get the files from /etc/data directory.
#!/bin/ksh
file_nm="/etc/dat"
for test_data in $file_nm/fln*
do
echo "$test_data"
done
the code is executing successfully , but in the output it is showing
... (6 Replies)
Hey guys,
I am VERY new to linux scripting and was wondering if you could help me with the following:
essentially the use case is the following...a service crashes and a script must be executed to rerun 3000 entries one at a time....your options are to do each of those manually, 1 at a time... (6 Replies)
I'm very much a newbie and hence why this is going to be a stupid question.
I'm attempting to create a korn shell script that pulls zone file locations and includes the copy command in the output. What?
getzonedir.ksh
#!/bin/ksh
while read -r domain
do ls */*"$domain" > $dir1
echo "cp... (5 Replies)
Hi All,
i have below for loop of which i am trying to redirect output in a file:
for i in `/usr/sbin/ifconfig -a | awk '/flags/ {print $1}' | grep -v lo | sed 's/://g'`
do
ifconfig $i dhcp status
done >> /tmp/logfile
but instead the output is appearing as stdout on screen rather than... (12 Replies)