3
votes
2answers
60 views

Is there a way to prevent a non-terminal-attached process from executing 'who' inside my .envfile?

I made some modifications to the /home/user/.envfile so the PS1 prompt would show date/time as well as the pwd etc. The modification is: # `who am i` is used to obtain the name of the original user ...
2
votes
3answers
130 views

Run a script on multiple shells?

I have two servers one AIX with default shell ksh, the other RHEL with default shell bash. I have a script that is mounted on both that will run similar commands but for either AIX or Linux. This ...
2
votes
1answer
51 views

How can I get KornShell to display the date and time in the prompt?

On my AIX box, which is using ksh as the default shell, I'd like the prompt to show both the date and time followed by a newline \n, along with the name of the machine, and the working directory. ...
0
votes
1answer
70 views

Why does this command not work on AIX?

I want to remove UTF-8 BOM from a file using this command: sed '1 s/\xEF\xBB\xBF//' old.java > tmp.java But it did not work. I am running with ksh on AIX 7.1
5
votes
1answer
261 views

What is #@(#) in Kornshell syntax

I'm looking at a script on an AIX box where several lines begin with #@(#) What does that indicate? Clearly doing a Google search is totally fruitless for symbols. Here are the lines from the ...
0
votes
1answer
130 views

aix ksh start weblogic server without nohup.out and return to underlying script

I am writing a ksh script, in which I want to start weblogic server in background and return to underlying script immediately(continue to execute the script) like this: nohup ...
5
votes
2answers
212 views

how to return to underlying script from tail -f

I have a ksh script, in which I use tail -f to view a log file. How can I terminate the tail process, and continue executing the underlying script? I am running it on AIX 7.1. ...
1
vote
2answers
228 views

Aix grep wildcard not working

I have a file called message that has the line CSC/UT/USA/WBIMB/SAP/orders05:orders05/ORDERS05/NONE/ORDRSP/758 I am doing a grep (Platform is AIX 6.1) grep ...
2
votes
2answers
53 views

Replacing a pattern with another between first and second occurrence of a pattern in file

Want the comma's (,) replaced by the alphabet u between the first occurrence of y till the second occurrence of y. Given below is the sample input file. 100y00893225900,008932259,06,2013,NOKIA Q ...
8
votes
2answers
345 views

Merge three file in to a single master file by excluding the header in 2nd and 3rd files

I have three file with n number of lines as given below sample1.txt ------------------------------ Date Time Name ------------------------------ 2013/10/12 12:09:09 Krish ...
4
votes
5answers
3k views

Next day of the user entered date - date +1 day

I am new to scripting I needed a script in the AIX environment to get the next days date based on the date entered by the user of the script. After hard time browsing for this I got a piece of code ...
1
vote
1answer
399 views

0403-053 Expression is not complete; more tokens expected

I have this piece of code given below as a part of my main script if [ -e /tmp/rsm/Logs/filename_$$.txt ]; then { total=0 for files in $(<filename_$$.txt); do #cd /tmp/rsm/Logs docs=`grep -i ...
3
votes
2answers
2k views

Need to get the difference between two time in seconds

The following two variables contain the start time and the end time , need to get the difference between these two time in seconds start_time=06:07:25 end_time=07:02:08 Desired Output diff_time= ...
2
votes
3answers
4k views

Multiple pattern match and print in single line

I need to match two patterns in a log file and need to get the next line of the one of the pattern (out of two patterns) that is matched, finally need to print these three values in a single line. ...
4
votes
1answer
64 views

Extract data from two files

I have two files as given below Output1.csv 201319107648361,12:27:04,12:27:14,0:0:10 secs 201319109089878,12:27:04,12:27:15,0:0:11 secs 201319108968961,12:27:15,12:27:54,0:0:9 secs ...
4
votes
4answers
2k views

Convert Unix timestamp into human-readable format on AIX

I need to convert unix timestamp (number of seconds since 1970, e.g. 1381260225 is Tue Oct 8 19:23:45 GMT 2013) into a standard human-readable format. I could get some answers by googling but those ...
3
votes
3answers
3k views

Subtracting dates in unix

Is there a way in unix to subtract a month or at least 30 days from a specific date? The date is to be inputted by the user. Example: 2012-11-19 - 1 month = 2013-10-19 This one doesn't work: date ...
3
votes
2answers
3k views

Can ksh on AIX be configured to use the tab key for filename completion?

I have some AIX 7 servers that are restricted to what software I can install and wonder if I can get ksh to use the tab key to complete filenames at the shell promot. The man pages are sparse for ksh ...
1
vote
1answer
299 views

How do you track memory usage in a ksh93 script

We have a number of ksh scripts that run forever (inside a while loop), or at least until a shutdown event is delivered to them. We had a project where these scripts where converted to ksh93 (and ...
4
votes
3answers
1k views

Preventing propagation of SIGINT to Parent Process

Considering a scenario where a Parent program (could be a C++ program or a Shell Script) executes a Child shell script, when we hit Control+C (or whatever character is configured to be the INTR ...
3
votes
1answer
235 views

Why is uname -M returning an empty string?

On the exact same machine (AIX 6.1), in 2 different login shells (both ksh), with different user IDs, I can do uname -M; in one shell I get the system model. In the other shell I get BLANK! The only ...
3
votes
1answer
1k views

Installing ksh as the standard shell in Redhat: Foolhardy?

I'm not a system administrator, but my organization is considering replacing /bin/sh in Red Hat Enterprise Linux 6+ with a hard link to /bin/ksh. How foolhardy would this be? The background to this ...
2
votes
2answers
1k views

Del key in AIX ksh over PuTTY telnet

At the place where I work we're developing under AIX with ksh and connecting to it via telnet. Most people use ArcTel to connect, while I prefer PuTTY. The only problem I have with PuTTY is that the ...
3
votes
2answers
1k views

Skip first 3 byte of a file

I am using AIX 6.1 ksh shell I want to use one liner to do something like this cat A_FILE | skip-first-3-bytes-of-the-file I want to skip the first 3 bytes of the first line, is there a way to ...
3
votes
1answer
1k views

Unset Read Only Variables

Is it possible to unset or change a readonly variable in Korn Shell? I am using AIX 5.
0
votes
1answer
66 views

what does “serial=${serial##*.}” do? [duplicate]

Possible Duplicate: How do ${0##/} and ${0%/} work? 0:root@SERVER:/ # 0:root@SERVER:/ # serial=$(lscfg -vl hdisk1 | awk '/Serial Number/') 0:root@SERVER:/ # echo $serial ...
1
vote
2answers
1k views

put tab before every output line on AIX/ksh

0:root@SERVER:/root # echo "something" | sed -e 's/^/\t/g' tsomething 0:root@SERVER:/root # AIX/ksh .. why doesn't it works? I just want to put a "tab" before every line!
12
votes
3answers
6k views

Getting size with du of files only

How can I get the size of all files and all files in its subdirectories using the du command. I am trying the following command to get the size of all files (and files in subdirectories) find . ...
2
votes
1answer
485 views

Tutorial about key maping in KSH in EMACS mode

Are there any good tutorial to learn about Key Maping in Korn Shell (AIX) in EMACS mode ?
2
votes
2answers
408 views

What could cause which to not show something in the path?

There is an executable in my path that I believe is a perl script. >$scriptname $outputofscript but >which $scriptname which: 0652-141 There is no $scriptname in $path and the path it ...