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

sed removing extra character from end

Hi, Searching through forum I found "sed 's/[ \t]*$//'" can be used to remove trailing whitespaces and tabs from file. The command works fine but I see minor issue as below. Can you please suggest if I...

View Article


Uniq count second column

Hello How can I get a number of occurrence count for this file; Code: ERR315389.1000156      CTTGAAGAAGAATTGAAAACTGTGACGAACAACTTGAAGTCACTGGAGGCTCAGGCTGAGAAGTACTCGCAGAAGGAAGACAGATATGAGGAAGAG...

View Article


Fill in missing rows with zero to have uniform table

Hello, I have two files of same structure except some rows are missing randomly in each file. How do I fill the missing rows to have the exact ID column (S01 ~ S96) and rest columns filled with "0"...

View Article

Add text in front of variable

I am just trying to add specific text in front of a ${variant} but can not seem to get the syntax correct. I have tried sed -i '$a NM_004004.5' ${variant} and printf "NM_004004.5:%s\n" ${variant} with...

View Article

Remove old file from directory

The below code creates a file ${id}.txt in the python directory. After the program closes and the user opens it again I am trying to remove the old file so the directory doesn't become too large. Code:...

View Article


Compare 2 columns of files awk

hello everybody I have 2 files the file1 has 10 columns and the form: Code: ... 110103 0802  1.16 38 20.16  22  1.21    8.77  0.00 20    120103 0832 23.40 38 22.10  21 46.35  10.17  0.00 28  120103...

View Article

Image may be NSFW.
Clik here to view.

Send mail from AIX 7.1

Hi, My OS version is AIX 7.1. I am trying to send an email with a file to my mail address. sendmail or uuencode does not work. Can someone give me the correct format ? I use: Code: uuencode <file...

View Article

UNIX doubt

In unix, does the file size present is In byte format ? Code: -rw-r-----+  1 stck    stck  20340713 Mar  3 10:11 C44444.STC.112 Can you you tell me how to filter the file size which should be less than...

View Article


Connection-less using ssh

Hi! I know its a recurring problem, but I am failing to sort this out, I have two servers ( A and B), in which I am able to connect without having to put password from server B to server A, but the...

View Article


Conversion from ansii to UTF 16

Hi I have a big file which is in ansii . I want to convert it to UTF-16 .Please help me on this as I am stuck at this point in unix .

View Article

Shell scripting with passing arguments

Hi All, I am using the script for creating local queue and passing the arguments while running the script as below Code: n=0 while [ $n -lt $1 ] do e=`expr $n + 3` echo 'DEFINE QL('$e') MAXDEPTH('$6')...

View Article

./1.sh: Syntax error at line 1 : `

Code: function user {         sqlplus primeit@$ORACLE_SID/primeit <<EOF       select user_name from test;         EOF         } function gen {         genpwdfile dec -in $1 -out $2         echo...

View Article

UNIX question on grep

Dear Sir, I need to remove the word /klp/ in all the files present in the directories can you tell me how to remove the word globally. Code: grep "/klp/" * -exec ls -l Once the above command is...

View Article


How to add password prompt between script ?

Hi Team, I need password prompt between this script .i want to need put password manually. Instead of adding password in script . Script pause till input password and resume again. Code:...

View Article

Issue in Concatenation/Joining of lines in a dynamically generated file

Hi, I have a file containing many records delimited by pipe (|). Each record should contain 17 columnns/fields. there are some fields having fields less than 17.So i am extracting those records to a...

View Article


What does xx mean in this while loop syntax?

I have a shell script which has this while loop line "while read tblName xx; do..." I understand how while loop works but don't know what does this xx stands for?

View Article

RHEL4.8 no notification on PAM lockout

Good day. I have setup hardening the password (test system so far) prior to doing any work on production. Here is what I have set. Snippet from /etc/pam.d/system-auth auth required...

View Article


Image may be NSFW.
Clik here to view.

awk to parse multiple lines

What is the correct syntax to have the awk parse the next line as well? The next in bold is where I think it should go, but I wanted to ask the experts since I am a beginner. The file to be parsed is...

View Article

How to change a set of characters between delimiters?

Hi all, I am trying to write a script for renaming some files and I can't understand how to replace a set of characters between delimiters with sed. The current filename is:...

View Article

sed - remove begin of line up to the third and including occurence of character

hello. How to remove all characters in a line from first character ( a $ ) until and including the third occurrence of that character ( $ ). Any help is welcome.

View Article
Browsing all 16232 articles
Browse latest View live