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

Parallel for in a Script Shell

Hello, This is my Script which configure a list of nodes. ( 40 nodes, and the configuration 10 minutes) Code: #! /bin/sh if [ $# -ne 1 ] then  echo "USE: ./start.sh nodes  else nb_lignes=`wc -l $1 |...

View Article


Wget in bash using sed and awk

In the bash below when the program is opened the download function runs and downloads the getCSV file and on the screen "Downloading getCSV.csv:%" displays and when it completes the menu function is...

View Article


Sum value using sed or awk ?

Hello all, how would one go about writing a command using sed/awk that will give me an output that can sum up the number of time each user has done something and also add the amount of time... so...

View Article

Do UNIX signals produce interrupts?

Hi folks! I have been reading Vahalia's Unix Internals book, which states the following in the chapter dedicated to signals: Quote: The receiving process becomes aware of the signal when the kernel...

View Article

DSL on SCO OpenServer 5.0.7

I have a dual boot computer with Windows 7 Pro 64 on one drive and SCO OpenServer 5.0.7 on another drive. The DSL modem works perfectly on the Windows side; I can input the gateway and DNS address...

View Article


Bash to search file

In the bash when the user inputs an id to search for the bash currently closes, and if a match is found outputs a new file (match.txt). Is it possible to have not close the bash but rather, on the...

View Article

Difference between two date

Hi, I created a script for finding the duration of a job using the start and end time of the job. But the command doesnt calculate correct value if the duration is more than 24 hours. Any help would be...

View Article

Insert content of a file into another file before given pattern

I need to insert file x2 into x1 right before first BBB line. Code: $ cat x1 AAA    1 AAA    2 AAA    3 BBB    1 BBB    2 BBB    3 $ cat x2 XXX - insert 1 XXX - insert 2 I need to get Code: AAA    1...

View Article


sed - search and replace whole string which contains dot

Hello. I would like to search exactly "string1.string2.string3" and replace it by "new_string1.new_string2.new_string3" And I would like to search exactly "string2.string3" and replace it by...

View Article


To count total of specific character in a file and save its value to a variable

Hi all, I have a file that contains characters. How do I get total of spesific character from that file and save the count to a variable for doing for calculation. data.txt Code: 1 2 2 2 2 3 3 4 5 6 7...

View Article

Moving files from parent path to multiple child path using bash in efficient way

Hi All, Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created. Code: /Path/AdminUser/User1/1111/Reports/aaa.txt to...

View Article

.Tar File

Hi 1) I have .tar file which i am going to extract in a particular environment. Now the files after extracting might be changed over time and I want to take the new tar of these files to put the same...

View Article

How to catch errors in a shell script ( multiple commands )?

Hi I have a shell script like that Code: Main() { DAY=$(date +"%d-%m-%Y") TIME=$(date +"%T") Command 1 Command 2 ... Command n } I would like to catch errors from all commands in Main() and write these...

View Article


Increment Column having Alphanumeric value in file

I want to replace a column(first and last) having an alphanumeric value in a file. Requirement : 1)All values in a Column must be unique and contain an incremented pattern “HCTV0096” for first column...

View Article

LVM Problems

Not really RedHat but CentOS, close enough. While moving my fileserver to a new rack I inadvertently connected the cables of the disk arrays to the wrong SAS ports. When I rebooted the disksgot...

View Article


Printing line in shell script

Need assistance in getting a shell program . I have csv file and each line has comma separated number. I wanted to take of the comas and print each number in each line . below example. Appreicate your...

View Article

Could not open /etc/.cpr_config

hello everybody. recently I have decided to change settings of power manager, and appeared the following message:(: Code: could not open /etc/.cpr_config I work with Sun Blade 1500, SunOs 5.10, CDE....

View Article


Need script to move files based on month

Hi , I need a script which moves files based on month. Example : Code: Apr 29 03:16 log4.txt Apr 29 03:16 log5.txt May  4 09:17 log1.txt May  4 09:17 log2.txt Move Apr files into Apr2015(Folder) Move...

View Article

Named resolving old fqdn on AIX after change to new fqdn.

Hey All, We have defined abc.this.that in: /etc/named.conf and corresponding files but after the change that we verified through dig -x this.that ptr all is resolving correctly. However in the...

View Article

Replace delimeter between quotes with \| using sed or awk

I've a pipe delimited data in a file of size 3GB. if the text data conatins pipe delimiter that will be enclose with double quotes. I have to replace delimiter which exists between double quotes with...

View Article
Browsing all 16232 articles
Browse latest View live