Search Results

Search: Posts Made By: mohtashims
Forum: Shell Programming and Scripting 3 Hours Ago
51
Posted By mohtashims
I tried #!/bin/bash /usr/bin/find...
I tried

#!/bin/bash
/usr/bin/find /app/Jenkins/home/jobs/test1/builds -type d -mtime 1 -exec rm -rf {} \;
/usr/bin/find /app/Jenkins/home/jobs/test2/builds -type d -mtime 1 -exec rm -rf {} \;...
Forum: Shell Programming and Scripting 6 Hours Ago
51
Posted By mohtashims
Unable to execute find command from inside a shell script
I have a shell script with 775 permission as below

/app/script/test.sh

#!/bin/bash
/usr/bin/find /app/Jenkins/home/jobs/test1/builds -type d -mtime 1 | xargs rm -rf
/usr/bin/find...
129
Posted By mohtashims
Any other solution apart from a reboot as this is...
Any other solution apart from a reboot as this is production server?
129
Posted By mohtashims
We are unable to force kill pid on AIX
I have a script that creates tar file and in the next command it gzip the tar file.

While the script was running midway i happen to force delete the tar file that was still being constructed.
...
309
Posted By mohtashims
@Rudic with your suggestion tar -X ./exclude.txt...
@Rudic with your suggestion tar -X ./exclude.txt -cf - ./1043 | gzip -c >/backup/App_Bckup.tar.gz I still get the below error messages:

tar: ./1043/B2KCOMP/b2kcomp/15002S10485964.70600 could not...
309
Posted By mohtashims
Combining tar and gzip errors on AIX system.
The below tar of folder 1043 command works fine on AiX system.

tar -X ./exclude.txt -cvf /backup/App_Bckup.tar ./1043 | tee /tmp/tar.out
gzip /backup/App_Bckup.tar ./1043

I wanted to combine...
469
Posted By mohtashims
The problem I face is that the match pattern...
The problem I face is that the match pattern comes from a variable thus using escape charecters becomes difficult and i get the below error:

sed 's/^.*/tmp/10203/cust/01$/<font...
469
Posted By mohtashims
Add text before and after matched string on the same line.
I have a file with many lines. Below I'm highlighting only those line that concerns me from the file.
....
drwxr-xr-x 4 user1 dba 20480 Feb 25 20:38 /tmp/10203/cust/01
.......
598
Posted By mohtashims
Remove lines containing strings from a file
Experts Hi,

I wish to remove lines containing the following strings from a file hello.out and save it in new_hello.out file.

1. text4
2. text5
3. text11
4. file13
5. file15
6. text16
...
2,122
Posted By mohtashims
Array declared in shell script works for AIX but fails in Linux
Array declared in shell script works for AiX 6.1 and above but fails in Linux CentOS 7.

I have the below code for Array in my shell script that runs fine on AiX systems.

Note: on AiX it uses...
2,121
Posted By mohtashims
Thank you @MadeInGermany that answers my query.
Thank you @MadeInGermany that answers my query.
2,121
Posted By mohtashims
@MadeInGermany i tried the ?* but the problem is...
@MadeInGermany i tried the ?* but the problem is i get .jsp files in the output because of '*.js?*' when a .jsp should not be returned in the output when i have -o -name '*.js?*'
...
2,121
Posted By mohtashims
@Neo Hi, Thank you for your inputs. I have...
@Neo Hi, Thank you for your inputs. I have updated the Original Post with the output.
2,121
Posted By mohtashims
Unable to find files using wildcard on AIX.
I wish to seach for files extensions .xml, .jsp followed by <whatever> charecters under directory custom while excluding folders "BACKUP" & "TMP"

Thus for a sample set like below:
...
2,620
Posted By mohtashims
@Rudic thank you for the input and it is...
@Rudic thank you for the input and it is certainly returning a single row however not the intended row.

If you look at the output when i pass 4 to get the 4th row it returns the 3rd row as the...
2,620
Posted By mohtashims
@Rudic sorry that was by overlook. With parameter...
@Rudic sorry that was by overlook. With parameter 3 the row returned should be the third row ie.
-rwxrwxrwx 1 user1 user 21624 Feb 11 17:13 httpd.conf_1581421456

Likewise when the user passes 4...
2,620
Posted By mohtashims
If the user passes 1 then i need the newest...
If the user passes 1 then i need the newest latest file.

If the user passes 2 then i wish to display only the newest - 1 file i.e second latest file.

if the user passes 3 then the third latest...
2,620
Posted By mohtashims
How do we display specific row of an output from bottom given line number?
I pass a number to my script. Passing "1" below.

./getfile.sh 1
echo "User entered: $1"
ls -ltr *.conf | sed -n '$p'
I wish to use ls -ltr i.e list files in ascending order of time the latest...
2,564
Posted By mohtashims
Need grep regex to extract multiline text between two strings
I have a file conatining the below:

---
10.9.16.116:
/tmp/5835113081224811756.jar:
hash: e6df90d38fa86f0e289f73d79cd2cfd2a29954eb
/tmp/4603745991442278706.jar:
hash:...
2,440
Posted By mohtashims
I need regex solution for grep and not sed as i...
I need regex solution for grep and not sed as i m using a tool called Ansible which has a module called as "lineinfile" module which i guess uses underlying python to interpret the regex.

I use...
2,440
Posted By mohtashims
Search for a text between two strings in a file using regex
Here is my sample file data:



My requirement is to have a regex expression that is able to search for visible starting string "SSLInsecureRenegotiation Off" between strings "<VirtualHost " and...
2,481
Posted By mohtashims
Thank you as it helped resolve the problem.
Thank you as it helped resolve the problem.
1,839
Posted By mohtashims
Make a copy of a file when someone tries to modify the file
I wish to take a backup of the file when someone tries to modify a file say /tmp/test.txt using vi, vim, cat, copy, mv commands.

I'm aware of inotify which will notify me of any changes to the...
2,481
Posted By mohtashims
@Rudic thank you for the explanation. Let's...
@Rudic thank you for the explanation.

Let's consider a sample file like below:


530 #Include conf/extra/httpd-ssl.conf
531
532 Include conf/extra/httpd-ssl.conf
...
2,481
Posted By mohtashims
Given the sample data i expect regex to return...
Given the sample data i expect regex to return NOTHING it should NOT MATCH anything but unfortunately it does.

Mine is a Oracle Linux system.
Showing results 1 to 25 of 500

 

Featured Tech Videos

All times are GMT -4. The time now is 11:08 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy