10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
(I am using bash)
I have a command that will find the line number in a file by searching for a string where it exists.
linenumber=$(grep -n "string" $FILENAME | cut -d : -fi)
This returns the line number and removes the string. Now that I have the line number I want to subtract 4 from it and... (5 Replies)
Discussion started by: prodigious8
5 Replies
2. Shell Programming and Scripting
Hi All,
I have some set of server and I want to write a code that can go to each server login as su and perform some command and redirect output of the command to the individual file.
The command is working fine in terminal.
1. To login as su: su - username (I have privilege so it won't... (6 Replies)
Discussion started by: kotak86
6 Replies
3. Shell Programming and Scripting
Dear all,
I have few log folders in directory (FILE) and i need to perform sed on each files inside each folders. Here is my script, and i wish to rename each file back to the same file name after modification. Can anyone guide me on my script below?
eg:
folder1 contain files... (2 Replies)
Discussion started by: ymeyaw
2 Replies
4. Shell Programming and Scripting
Hi,
I have a directory /home/datasets/ which contains a bunch (720) of subdirectories called hour_1/ hour_2/ etc..etc.. in each of these there is a single text file called (hour_1.txt in hour_1/ , hour_2.txt for hour_2/ etc..etc..) and i would like to do some text processing in them.
Each of... (20 Replies)
Discussion started by: amarn
20 Replies
5. Shell Programming and Scripting
Hi,
I want to access files from different directories (for example: /home/dir1/file1 , /home/dir2/file2 ...) Like this i have to access these files(file1, file2...). (3 Replies)
Discussion started by: bangarukannan
3 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I will use below command for grep single string ("osuser" is search string)
ex: find . -type f | xarg grep -il osuser
but i have one more string "v$session"
here i want to grep in which file these two strings are present.
any help is appreciated,
Thanks in advance.
Gagan (2 Replies)
Discussion started by: gagan4599
2 Replies
7. Shell Programming and Scripting
Hello
I have the following output which is returned with the Month in text format instead of numerical. The output I receive is performed by using Rational Synergy CM software commands from the Unix command line and piping Unix commands on the end.
bash-3.00$ ccm query -n... (4 Replies)
Discussion started by: Glyn_Mo
4 Replies
8. Shell Programming and Scripting
I have 2 files. I basically want to search both of them to see if the 1st column ($1) matches and if it matches then check to see if the 2nd column ($2) matches, then execute some code showing the results of the matches.
File 1:
AAA 123
misc blah
BBB 456
CCC 789
File 2:
... (2 Replies)
Discussion started by: streetfighter2
2 Replies
9. Shell Programming and Scripting
Hi,
I needs to split *.txt files from single directory depends on the some mutltiple input values. i have wrote the code like below
for file in *.txt
do
grep -i -h "value1|value2" $file > $file;
done.
My requirment is more input values needs to be given in grep; let us say 50... (3 Replies)
Discussion started by: arund_01
3 Replies
10. AIX
I have this Korn script that I wrote (with some help) that is run by cron. I basically watches a file system for a specific filename to be uploaded (via FTP), checks to make sure that the file is no longer being uploaded (by checking the files size), then runs a series of other scripts. The... (2 Replies)
Discussion started by: heprox
2 Replies