How to print elements between letters bash script?
Hello to all, May somebody help me to fix my bash code below, I'd like to do it only using loops and if statements is possible. I the content of the arrays are represented by the following 2 strings,...
View Articlescp and uncompress on the file?
Hi, Is there any way to do scp and uncompress on the fly? At the moment, I am doing scp and then running uncompress of the .Z files in the background. I am wanting to be able to do scp and then have...
View ArticleExplaination on export command
Hello Team, Could you pls explain how export command works in below code: Code: for i in ${!SDV_*}; do export $i done As per my understanding, if Code:...
View ArticleIs there any way to cat multiple files and show filenames?
Hi, Is there any way to do a cat * where it shows the name of each file in the process? Similar to what more does below? Code: $ more ?.sql :::::::::::::: 1.sql :::::::::::::: set linesize 200 select...
View ArticleConflicting GID in group and passwd files.
Hi guys, I have a question. In the passwd file, user johndoe has a GID of 100 which is the group named users in the group file. But if you check the group file, johndoe is not listed under GID 100, but...
View ArticleSamba configuration
Good morning. I installed Samba on my server but I need some help in consfiguratin: 1. Access only for users from my network 2. Create catalog for all users, users not login - only read, users log in -...
View ArticleHelp required on Length based lookup
Hi, I have two files one (abc.txt) is having approx 28k records and another (bcd.txt) on is having 112k records, the length of each files are varried. I am trying to look up abc.txt file with bcd.txt...
View ArticleGcc .bz2
Hello, I need to install GCC but the only archive (GCC-4.9.2) for it I can find is a .bz2 format file. Looking at http://www.unix.com/shell-programmin...2-library.html provided some help, but when I...
View ArticleAIX UNIX - script on how to extract from log file with previous date
Hello, I am new to this forum so any assistance would help. I am currently trying to develop a script that extract all data from a log file with has the previous day's date. Code: $...
View ArticleSHELL: syntax error near unexpected token `else'
Hi, I wrote this shell script to be a tool for my team to do daily routine works. Though, option a and b are working fine, option c is giving below error. line 647: syntax error near unexpected token...
View ArticleGet last month files
Hi All, How to get last month files. Ex : 1st Jan i have to get Dec 31 days files and on Feb 1st i have to get Jan 31 days files and on Mar 1st i have to get Feb 28 days files. Below are the example...
View ArticleReplace failed drive in pool
I am not very savvy with Solaris but am responsible for a server running Solaris 10 that has a failed hard drive in a mirrored pool. I ordered a new drive and attempted to install but received the...
View ArticleConfiguring vi / vim ?
Just got a new server running Oracle Linux 6 (a derivitive of RHEL, but I'm not sure the version correlation). This is my first hands on with this verision, having worked in the past with OL 5 (as well...
View ArticleMaxuproc and limit
// AIX 6.1 & Power 7 server I have maxuproc set to 16384. Code: lsattr -El sys0 -a maxuproc maxuproc 16384 Maximum number of PROCESSES allowed per user True What is the maximum number of maxuproc...
View ArticleHelp with if statement syntax in shell script
I want to make the file test condition a variable ($Prmshn in code below). My goal is to use something like the first three unsuccessful if statetments since the 'if [[' is the newer style. Note: I...
View ArticleCan sed use a file on the syntax?
Dear all, I need help, again. I would like to use a sed on a for. Is is possible to ask sed to call a file in the syntax? For exemple: Code: sed "/Y/ s/number/X/" test_imput > test_output where Y...
View ArticleFinding all files based on pattern
Hi All, I need to find all files in a directory which are containing specific pattern. Thing is that file name should not consider if pattern is only in commented area. all contents which are under /*...
View ArticleAppending CRLF to end of record
I need to append |\r\n (a pipe character and CRLF) at end of each record in Unix to all records where they are not already present. So first check for the presence of |\r\n and if absent append it else...
View ArticleSpace usage by top 5 users in a filesystem
I want to see top 5 users,who have occupied most amount of disk space in a filesystem. But not sure how to do it. I can get the usage for a particular user find . -user user -type f exec df -h {}...
View ArticleRuntime variable extraction
Hi There, var1=value1 var2=value2 var3=value3 for (( i=1; i<4; i++ )) do temp=var$i echo "$temp" done OUTPUT var1 var2 var3 I want the output to be value1 value2 value3 How can I achieve this?...
View Article