Search Results

Search: Posts Made By: mohtashims
Forum: Shell Programming and Scripting 19 Hours Ago
90
Posted By mohtashims
stat file does not exists on AiX. There is a file...
stat file does not exists on AiX. There is a file called status but it is seems encrypted.

See below:

ls -ltr /proc/15598024/stat
/proc/15598024/stat not found
$>ls -ltr /proc/15598024/stat...
Forum: Shell Programming and Scripting 19 Hours Ago
90
Posted By mohtashims
Do we have generic solution get process start time in AIX & Linux
I wish to get the process start time on AiX and Linux using the same command / script.

I'm able to get the process start time in Linux using the below command:

cat /proc/<pid>/stat | grep...
347
Posted By mohtashims
@RudiC, Thank you for the answer. It worked !!
@RudiC, Thank you for the answer. It worked !!
347
Posted By mohtashims
Delete all files of a particular name & extension except one file.
I wish to delete all files that starts with "body<any number of digits>.xml" except body65.xml on Linux 7 bash shell

So, from the below files

body64.xml
body.sh
body65.xml
body655.xml...
536
Posted By mohtashims
But, my requirement is to add only after the...
But, my requirement is to add only after the first occurance. A non sed solution will do.
536
Posted By mohtashims
Insert text after the first occurance of searched string entry in a file
My server xml file has huge data part of which i'm sharing below.



I wish to add the below text held by variable "addthisline" after the closing braces i.e --> once the first </Connector>...
1,380
Posted By mohtashims
Thank you .... Works Perfect @Corona @RudiC.
Thank you .... Works Perfect @Corona @RudiC.
1,380
Posted By mohtashims
@Rudic thank you for the inputs. How can we...
@Rudic thank you for the inputs. How can we assign the passed array to a variable in the function. I ask this becoz i did not get a chance to go back to my system and try out how to do that.
1,380
Posted By mohtashims
How to pass and read an array in ksh shell script function.?
I'm able to read & print an array in varaible called "filelist"

I need to pass this array variable to a function called verify() and then read and loop through the passed array inside the...
1,195
Posted By mohtashims
Resolved the issue by this logic VAR1=`echo...
Resolved the issue by this logic

VAR1=`echo "${1}" | sed -e "s/'//g"`
echo "${VAR1}" |
while IFS=' '
read -r dirpath
do
if [ $tmp -le 1 ]; then
fileis=`echo "$dirpath" | awk -F'...
1,195
Posted By mohtashims
Need to filter string between specific string in ksh
My argument has data as below.

10.9.9.85
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr5.scr 127869538
-rwxr-xr-x user1 2019-10-15 17:40 /app/scripts/testingscr56scr 127869538...
1,361
Posted By mohtashims
Any other solution please ? As the arguments are...
Any other solution please ? As the arguments are constructed by variable substituted values constructed at runtime.

Considering I have root privileges , can I modify this setting somewhere ?
1,361
Posted By mohtashims
Looks like i was not able to understand as well...
Looks like i was not able to understand as well as explain the problem.

here is the problem where i'm running the test.sh script and passing a very long argument with terminal set to ksh like...
1,361
Posted By mohtashims
Increase command length for ksh shell on Redhat Linux
I have a ksh shell script and i need to pass arguments which are generated by data pulled from a database.

When the argument to the shell script is too long (about 4000 charecters) the below is...
1,286
Posted By mohtashims
@Andrew you got it Right :) and sorry if my...
@Andrew you got it Right :) and sorry if my explanation in the OP was not clear.

I will test the performance of your code. By the way I'm using ksh and not bash on AiX 6.1
1,286
Posted By mohtashims
Checking for substring in a loop takes too long to complete.
I need to check if the files returned by ls command in the below script is a sub-string of the argument passed to the script i.e $1

The below script works fine but is too slow.

If the ls...
1,243
Posted By mohtashims
List filename of files only inside a directory (non-recurrsive) on AIX
I wish to list only files along with the absolute path in a given directory on my AiX 6.1 system.

Below is the best I could do.
ls -p "/app/scripts"/*


This gives a a list of all filename...
1,336
Posted By mohtashims
Copy local files to single remote host but multiple folders using rsync
I'm trying to copy a file myfile.scr from my local Linux server to multiple folders on remote AiX server using single rsync command.

Below command helps me copy the file "myfile.scr" from my...
1,678
Posted By mohtashims
@Gull04 removing -e works. Thank you for the...
@Gull04 removing -e works. Thank you for the inputs.
@MadeInGermany I will try you suggestions tomorrow.
1,678
Posted By mohtashims
Getting error: --- Post updated at 02:53 AM...
Getting error:

--- Post updated at 02:53 AM ---



@Gull04: I tried your option but i get -e -e before the first element. Please see output below:
1,678
Posted By mohtashims
The arguments passed to the script come from the...
The arguments passed to the script come from the database in the format I shared and cannot be changed hence the proposed solution would not work.

Is there a way to replace all \\n to single...
1,678
Posted By mohtashims
Issue handling single quoted argument in shell script.
Below is my script that works fine and prints the desired output:

#!/bin/ksh
echo "$1" |
while IFS= read -r dirpath
do
echo "DIRR_PATH:$dirpath"
install_dir=$install_dir" "$dirpath...
1,567
Posted By mohtashims
@MadeinGermany: I love your answers !! They are...
@MadeinGermany: I love your answers !! They are precise :b:

Works fine. I will test more conditions shorlty.
1,567
Posted By mohtashims
Read file or variable input in while loop does not work on AIX system
I'm working on Aix 6.1 and using ksh shell.

The below works fine on Linux bash or ksh shell [tested both].

while IFS= read -r dirpath ; do
echo "Hi"
done <<<"$var"

However, any such while...
1,789
Posted By mohtashims
This has dependency on coreutils. I am...
This has dependency on coreutils.

I am writing on getting that onboarded.
Showing results 1 to 25 of 500

 

Featured Tech Videos

All times are GMT -4. The time now is 10:29 PM.
Unix & Linux Forums Content Copyright 1993-2019. All Rights Reserved.
Privacy Policy