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 ArticleHow 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 ArticleWhere 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 ArticleHi 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 ArticleFor 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 ArticleIm 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 ArticleNeed 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 Articleselecting 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 Articlecharacter 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 Articlehow 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 ArticleWhat 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 ArticleHow 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 ArticleMoving 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 ArticleHow 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 ArticleConcatenate 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 ArticleReplace 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 ArticleAccess 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 ArticleReplace 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 ArticleMultiple 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 ArticleRSA 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