script to eliminate left and right fields and to get the ouput.
Hi Experts,
I have a file as given below and want to filter out the filenames in it , by deleting left and right filds and to have the fllenames (There are spaces in the filename),
I want to eliminate first 7 field from left side , and 4 fields from right side , and to get the output . Is there anything available with scripting , sed awk ?
Output should be:
Thanks in advance,
Last edited by vgersh99; 10-21-2009 at 07:28 PM..
Reason: code tags, please.
Hi,
my perl script is calling another external java program. The Java in turn prints out a string. how can I capture the string.
------------------
#!/usr/bin/perl
print "Content-type:text/html\n\n";
use CGI;
$query = new CGI;
$theCookie = $query->cookie('someCookie');
$user =... (0 Replies)
RH Linux, $SHELL=/bin/ksh
I have a .profile which I source in as such --> . .profile
Whats happening is the variables are getting validated and generating errors.
for example
.profile
export foo=/to/the/moon
when I . .profile , I get
: not foundmyusername/.profile
or bad... (8 Replies)
Good Morning,
Newbie here. Could someone help with shell scripting that will enable me to combine 2 fields into one eliminating the white space. The fields are fixed but the data of course varies.
For example:
First Name: "George " 20 positions"
Last Name: "Washington " 30 positions"
I need... (2 Replies)
Hi
I am very new to shell scripting and have written a script (below).
However the directory I am searching will contain a file with a .trn extension each day which I want to eliminate.
Each day the file extension overnight will change to trx, if this fails I want to know.
Basically what I... (2 Replies)
I have this one::) doing jstack on JVM proccess.
#!/bin/ksh
# ----------------------------------------------------
# capture_jstack.sh <INTERVAL> <COUNT>
# run jstack and capture output to a log file
#-----------------------------------------------------
#
# scripts and logs are stored... (3 Replies)
Hi guys, I'm try making to script for eliminate files rlogins.
path1='/home/*'
for i in `cat /etc/passwd |awk -F: '{print $6}'`; do
if test "$i" = "$path1"; then
echo $i
cd $i
if ; then
echo "$i/.rhosts detectado"|mail -s "rhosts" root
... (14 Replies)
I have this input file
Switch 0; Sun Sep 11 12:40:53 2011 EDT (GMT+4:00)
12:40:53.159984 SCN Port Offline;g=0x1e4b6 A2,P0 A2,P0 379 NA
12:40:53.159991 *Removing all nodes from port A2,P0 A2,P0 379 NA
18:45:31.326604 Port Elp engaged ... (1 Reply)
I'm attempting to write a bash script that will create a network between virtual machines. It accepts three arguments: an RSpec that describes the network topology, and two list of machines (servers and clients).
I have a (working) Perl script that I want to call. This Perl script takes an RSpec... (6 Replies)
Hello Lads,
I deployed a script on my mac to start and stop EC2 instances on AWS console. The script when started manually on the terminal does the expected stop and start. Problem is when i try to schedule it on a cron, it fails to recognize the AWS Keys which i set up as ENV variable by... (2 Replies)
Hi All,
I am trying to print all the packages info in solaris 11 using below script.
#!/usr/bin/env bash
pkginfo -l | egrep '(BASEDIR|NAME|VERSION)' | awk '{print}' > /tmp/cp1
/usr/bin/nawk -F: '
{for (i=1; i<=NF; i++) {gsub (/^ *| *$/, "", $i)
... (5 Replies)