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

Select 2 columns and transpose row by row

Hi, I have a tab-delimited file as follows: Code: 1  1  2  2  3  3  4  4 a  a  b  b  c  c  d  d 5  5  6  6  7  7  8  8 e  e  f  f  g  g  h  h 9  9  10 10 11 11 12 12 i  i  j  j  k  k  l  l 13 13 14 14...

View Article


How to catch a two word keyword which may contain a new line(may include...

How to catch a two word keyword which may contain a new line(may include spaces or tab) in it. for example there is a file a.txt. Code: $more a.txt create view as (select  from ......... .......... (...

View Article


Where does OS X store LDAP and login settings?

I'm writing scripts to check for compliance with the DISA STIG. Several items refer to manually click-click-clicking to verify settings regarding LDAP or accounts like guest account disabled, "Allow...

View Article

Hi im new to bash scripting I want to know what does the regex expression do ??

# check host value regex='^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$' if [ "$(echo $host | grep '[A-Za-z]')" != "" ]; then if [[...

View Article

For loop failing cd command

Hi guys, i've wrote the following loop; Code: for i in `ls`  do  cd $i/host  cat "xxxx.txt" |grep "yyyy" >> zzzz.txt  done I have a set of folder with different name and i need to extract a value...

View Article


Im new to bash scriping and i found this expression on a bash script what...

# check host value regex='^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$' if [ "$(echo $host | grep '[A-Za-z]')" != "" ]; then if [[...

View Article

Need to print between patterns AND a few lines before

I need to print out sections (varying numbers of lines) of a file between patterns. That alone is easy enough: Code: sed -n '/START/,/STOP/' I also need the 3 lines BEFORE the start pattern. That alone...

View Article

selecting certain files

Hi, I have been working on a punch of codes and I got to a problem I hope to get help on. I have some files that I want to work with but the folder has other files in it. For example: The folder...

View Article


character limit via awk

I'm using a command that outputs the total size of the files that I've specified. I'd like to introduce a character limit that appends an ellipsis to the lines that go beyond the specified amount....

View Article


how to use array variables in shell

Hi, everyone. I wrote a code like this Code: for f in HB021*   do   program done for f in HB034*   do     program done for f in HB056*     do       program done . . . . . . I know that a loop with...

View Article

What does this do in CSH?

CSH experts What does the following do in CSH? Code: :(){:|:&};: I was asked the question, but I don't know. I'm not aware of the context. Any ideas? Thanks!

View Article

How to create a cron job to take an uploaded filename and move it

OK, So complete newbie here. I would normally do this in PHP or through my FTP program script but I can't in this case (the files are not coming from me, coming from a third party FTP upload). I have...

View Article

Moving server...need to find all hard code IP references

I'm moving my web server to a different datacenter. OS is CentOS 5.8 Apache 2.2.3 qmail NcFTPd Its been 12 years since I relocated a server. Lots of brain cells lost since then...:-) I need to identify...

View Article


How to Sort by Date and Time

Hi, The input file is as follows, 22.06.2012 17:58:38 CPUser: xxxxxxx, billedAfterStatus: Active 13.07.2012 08:46:15 CPUser: xxxxxxx, billedAfterStatus: Active 20.07.2012 08:56:24 CPUser: xxxxxxx,...

View Article

Concatenate Numerous Files

Hey! I wanted to find a text version of the Bible for purposes of grepping. The only files I could find, (in the translation I wanted), were Old Testament.txt and New Testament.txt. I thought, "fine,...

View Article


Replace string, grab files, rename and move

Hello there! I'm having a lot of trouble writing a script. The script is supposed to: 1) Find all files with the name "Object.mtl" within each folder in the directory:...

View Article

Access to edit

Hi Admin, can you please gimme the access to modify my posts in the thread http://www.unix.com/302599425-post12.html Thanks in advance

View Article


Replace leading space(s) from beginning of line by one tab

hello does someone want to help me for this one ? in text files i want to replace leading space(s) from beginning of line by one tab when there are space(s) with the sed code Code: sed -i".bak" 's/^[...

View Article

Multiple occurance of file

Hi all, I have file structure as file.log Code: 84t-rw-r--r-- 1 emily04 us_cms 24492717 Oct  5 13:29 vgtree_84_1_K3L.root 85t-rw-r--r-- 1 emily04 us_cms 50410380 Oct  5 16:06 vgtree_85_1_uZv.root...

View Article

RSA encryption

Hi everybody, I know this is a linux forum but I've got a question about encryption. If you want to encrypt (and decrypt) more than one byte at a time do you have to choose sufficiently large numbers...

View Article
Browsing all 16232 articles
Browse latest View live