Quantcast
Channel: UNIX and Linux Forums
Browsing all 16232 articles
Browse latest View live
↧

IFCONFIG is available... sort of

So, I have this script that makes a call to ifconfig to pull the interface information and report it. When I log on to the machine the script works just fine. But, if I'm on a remote machine and I make...

View Article


Extracting specific lines from data file

Hello, Is there a quick awk one-liner for this extraction?: file1 Code: 49389 text55 52211 text66 file2 Code: 59302 text1 49389 text2 85939 text3 52211 text4 13948 text5 Desired output Code: 49389...

View Article


SFTP -- Outgoing IP

Hi Gurus; I had 2 interface. eth1 : 10.x.x.x eth2 : 30.x.x.x My default out is 10.x.x.x Now, I need to connect to public SFTP Server If I use sftp user@public IP. I can not connect. because my out is...

View Article

Prevent word splitting with file with spaces in name

Hello, I have a script that "validates" a ZIP file that look like this Code: AAA_20120801.zip => x~back end~20120801.TXT y~time in~20120801.TXT z~heat_chamber~20120801.TXT AAA_20120801.ctl My task...

View Article

Awk Problem - Fixing needed

os: sunos/linux shell: bash Code:                         awk -v PCT="$PERCENTAGE" -v UWARN="$UWARNING" -v UCRIT="$UCRITICAL" 'BEGIN {                                 PCT=PCT+0; UWARN=UWARN+0;...

View Article


getting error while substituting variable using sed..

I am using script for substitute one variable with another variable like below... below code works fine... Code: sed 's/'$sub_fun'/'$To_sub'/g' But when i run the same code from the script getting...

View Article

Image may be NSFW.
Clik here to view.

How archive the older than 30 day files to another unix server

I need to archive the older than 30 day file to another uinx server.I have wrote the below uinx script. Code: for LOOK_DIR in /TempFiles do     for FILE in `find ${LOOK_DIR} -mtime -30 -exec ls {} \;`...

View Article

awk calculation automatically rounding off the output

I have some calculation in my script which is similar to the below example . I find that sometimes when using large decimal digits, the output gets automatically rounded off and it is affecting the...

View Article


Image may be NSFW.
Clik here to view.

Word matching and write other data

Hi all, I have 7 words Code: CAD CD HT RA T1D T2D BD Now I have 1 file which contain data in large number of rows and columns from 2 nd column onwards it contain any of these 7 words or may be more...

View Article


Suppress Error Message

How can I suppress a error message being given by awk command in bash shell?

View Article

Image may be NSFW.
Clik here to view.

append column and row header to a file in awk script.

Hi! Is there a way to append column and row header to a file in awk script. For example if I have Code: Jane  F  39  manager Carlos M  40  system administrator Sam    F  20  programmer and I want it to...

View Article

Change unix permission when I don't own the file

Hi, A file is transferred from a Windows server(say username : user1) to Unix server via ftp. In unix, the permission of the file for a user, say user2 will be "-rw-r-----". Since the user1 is the...

View Article

How to get current power consumption of a machine

Hi Is there any native commands or somewhere in the /proc files to get the machine's power consumption? I googled for a while and cannot really find this information Thanks for your help.

View Article


Difference between shells

ple tell me What is the diff between ksh,sh,bash and csh

View Article

format log file

Hello, I am on solaris [ KSH ] here is what I have Code: *****LIST OF ATTRIBUTS FROM FILES***** FILE='/N1B/2002/05/ACL1B_2002_05_01_B_00.TAR...

View Article


Displaying a number in binary using perl

printf FH2" 3'b%b : begin\n",$i; where i is an integer in the loop is displaying 3'b1 : begin expected output was 3'b001 : begin

View Article

Image may be NSFW.
Clik here to view.

Need to Mount LUKS external drive on Fedora

I had installed Fedora 16 a while back and chose to encrypt my home directory. I have removed the drive and installed a new drive, installed F17 and would like to attach the old drive externally and...

View Article


use cut or awk to print line after "/bin"

Hello all, i am trying to use cut or awk to make my below lines to From $ ps -ef|grep tns|grep -v grep |grep LISTENER_TEST|awk '{print $9}' /oracle/ORAHOME/test/112/bin/tnslsnr to...

View Article

How to clear contents of a file without deleting it.

Hi, I have a script which will use an input.txt file as an input file. I am providing data to this input file in the script and once the script is executed, I want to clear all the contents of this...

View Article

perl script to remove the extension from its name

There are few files in my windows directory and I need a perl script to rename the files to its original names i.e., the last extension(.orig) needs to be removed programatically, files in directory...

View Article
Browsing all 16232 articles
Browse latest View live