10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello everyone,
I have written simple script below to check if ip is added to interface
#!/usr/local/bin/bash
IFCONFIG="/sbin/ifconfig"
SERVICE="/usr/sbin/service"
IP="79.137.X.X"
GREP=$(${IFCONFIG} | grep ${IP})
ip_quantity_check () {
echo ${GREP} | wc -l
}
if ];... (2 Replies)
Discussion started by: bryn1u
2 Replies
2. Shell Programming and Scripting
I am doing a simple "recycle bin" script. It is to check and see if the directory .TRASH exists within the home directory. If not then it makes the directory then appends a date and time to file and then finally moves the file in. However, when I run this script, it is not making the directory as... (5 Replies)
Discussion started by: iamdeman
5 Replies
3. Shell Programming and Scripting
Hi! I'm a newbie and can't find the exact sed to make this work. I've installed CentOS and am trying to pass variables to a network-config file.
variables:
$ipAddress
$netmask
$gateway
file:
DeviceList.Ethernet.eth0.IP=192.168.1.10
DeviceList.Ethernet.eth0.Netmask=255.255.255.0... (5 Replies)
Discussion started by: greipr
5 Replies
4. Shell Programming and Scripting
I have a long string that looks something like this....
<string>http://abc.com/40/20/zzz061-3472/dP3rXLpPPV2KC846nJ4VXpH7jt4b3LJgkL/tarfile_date.tar</string>
I need to but the tar file name. So I need to put between "/" and ".tar</string>". My desired result should be "tarfile_date". (7 Replies)
Discussion started by: elbombillo
7 Replies
5. UNIX for Dummies Questions & Answers
I start wetting my toes in Linux programming.
I tried the first program myls.c in Advanced Programming in the Unix Environment.
#include <sys/types.h>
#include <dirent.h>
#include "apue.h"
int main(int argc, char *argv)
{
DIR *dp;
struct... (1 Reply)
Discussion started by: cqlouis
1 Replies
6. Shell Programming and Scripting
Hi all,
i have used the search already before someone shouts at me and i have seen the 'datecalc' program but this is not working correctly for me in the shell and environment i am using.
I am using solaris 10 and bourne shell.
I have two dates '07-04-2009' and '05-05-2009'. I just need to... (2 Replies)
Discussion started by: muay_tb
2 Replies
7. Shell Programming and Scripting
#!/usr/local/bin/perl
open (MYFILE, 'logs_report');
while (<MYFILE>) {
$rec=$_;
chomp ($rec);
@arr=split(/ /,$rec);
print $rec,"\n" if ($arr!~/OK/);
open (MYF, '>data.txt');
print $rec,"\n" if ($arr!~/OK/);
close (MYF); (14 Replies)
Discussion started by: SkySmart
14 Replies
8. UNIX for Advanced & Expert Users
I have a program. Everytime that I run that program ,it prints a disclaimer msg and prompts the user to accept the agreement (i.e: type 'y' or 'n').
Now I want to run the program multiple times with different inputs. So I wrote a script which runs in a loop and calls the program multiple times.... (2 Replies)
Discussion started by: the_learner
2 Replies
9. Shell Programming and Scripting
I know that this is a ridiculously simple statement, but I am getting an error when I execute it, and I can't figure out what it is. Can anyone point me in the right direction?
#!/bin/ksh
integer dateMonth=0
integer intZero=0
if
then
dateMonth = 1
fi
echo $dateMonth (7 Replies)
Discussion started by: mharley
7 Replies
10. UNIX for Dummies Questions & Answers
The script below is supposed to list file and folder names and list the type besides each - It has no practical value - I am just trying to learn KSH (so far sounds like a bad idea!)
Expected output should look like this:
folder 1 *** dir ***
file1 * file *
The code runs but produces... (9 Replies)
Discussion started by: GMMike
9 Replies