1
vote
1answer
301 views

Extract a single file from a tar file to another directory

I have a tar file and I need to extract a single file from it and put it to another directory. I tried this but it gives an error message. It did extract the file but not to the directory that I want ...
1
vote
1answer
836 views

Adding a month to an input date in unix

I need to write a script that asks user for an input date. Then I need to add a month to that date or at least 30 days. Example: Date: 2009-05-12 I need to get 2009-06-12 this code is not working: ...
3
votes
1answer
308 views

Delete old log files in AIX

I am trying write a script to delete old log files in \var\log\applog\nmon on my AIX system. We usually get alerts that the file system is almost full and at the moment delete old files by hand. So ...
0
votes
2answers
168 views

Korn Shell .kshrc

I'm trying to make the UP arrow to get previous command in Korn Shell but I can't find .kshrc file in my $HOME directory. I know it is hidden but even ls -al doesn't show it. What should I do?
3
votes
2answers
363 views

Unix HP-UX ksh recursive find and replace

I am trying to do a recursive find and replace in HP-UX and am missing something. What I have at the moment: find . -name "*.java" | xargs sed 's/foo/bar/g' I know the problem is that it's not ...
1
vote
2answers
100 views

FIND operands and order of arguments

I have a find command that I am unsure if I am placing my arguments correctly. find / -xdev -size -size -262144000c -o -type d \( -name .snapshot -o -name man -o -name Man -o -fstype mvfs \) -prune ...
0
votes
1answer
124 views

dynamically allocating space for variable in ksh

I am new to ksh unix shell scripting.I need my ksh script to get inputs from the user. and the number of inputs is unkown. I need to get the inputs and process again further .The sample run could be ...
0
votes
3answers
262 views

What will happen when I 'cat' 'ksh'?

I used the following command in my unix box. $ cat ksh And it gave a rolling log of latin and greek letters and symbols and it kept on going with no signs of stopping. Eventually I had to close my ...
0
votes
2answers
9k views

how to fix Permission denied on directory in unix?

I have a ksh file which will download a zip file from the internet in the /tmp directory with name f.zip Why do I get Permission denied? $ ./downloadbcfi Current name is ...
0
votes
4answers
89 views

Unix find command help

Hi can anybody help me with the following line; find . \( -type d ! -name . -prune \) -o -type f -name "*Log*" Basically it should find directories where files with "Log" in their name are present. ...
0
votes
1answer
37 views

How to write code for this archival scenario?

Say after the 1st run, 10 files got created with def user id in abc directory. I tarred the 10 files created by def user id in a tar file with date time stamp extension. Now after the 2nd run, ...
1
vote
1answer
101 views

How to write this script in unix?

How can I write a script for finding the files created by a particular user ID in some locations and tar those files in the same location?
4
votes
3answers
1k views

Unix history not working

I'm using ksh on unix and connect through putty. My .sh_history stores all history commands but when I press up arrow nothing comes, please help me.
0
votes
0answers
92 views

Overlapping lines in AIX 5.3

When I type commands and hit enter my cursor line for some reason appears on the the second line from the end of the output: tomcat [server] /home/tomcat: ls -l total 24 -rwxr-x--- 1 tomcat dev ...
4
votes
2answers
611 views

How can I keep reading from a pipe even after the pipe is closed?

I've got a ksh script that calls: while read LINE do... The input has been redirected (not shown) so that it reads input from a pipe. The problem is that when the writer to the pipe closes, read ...
0
votes
1answer
3k views

ksh Auto-Completion PuTTY Configuration

I'm having a bit of a problem configuring my PuTTY client to work with the auto-completion feature in the ksh shell. I do a listing on the root with the directories /home and /homeroot and it returns ...
0
votes
5answers
727 views

Start linux command with “su” and inline variable

I'm trying to create mozilla profile for another user from command line using su. When I'm trying from X, this will work. su myuser -c 'mozilla -CreateProfile newprofile' But my goal is to embed ...
2
votes
3answers
4k views

unix command to see the last run command on command line

what is the command to see the previously executed command that was run on the command line ?
0
votes
1answer
72 views

Is There Any Danger in Closing a Parent Xterm Shell with an Active Child?

When I log into my unix servers, I get an xterm window and usually open several more from that initial one. Is there any danger in closing the first window but keeping the children windows open?