Questions tagged [unix-shell]
130 questions
1
vote
1 answer
Error when using mv
I am receiving an error when trying to mv some files that really doesn't make sense. I receive this error:
mv: cannot move `thatDir' to a subdirectory of itself, `/usr/local/apache-tomcat-6.0.32/webapps/thatDir'
When running the following command…

Inversus
- 123
- 5
1
vote
1 answer
How to combine files with unix cat command based on file name, then rename?
I have a bunch of CSV files in a directory like:
modfinalak_1.csv
modfinalal_1.csv
modfinalal_2.csv
modfinalal_3.csv
modfinalar_1.csv
modfinalar_2.csv
so it's one or multiple files per each US state (AK, AL, AR, etc.). How can I use cat to combine…

tiredofcoding
- 13
- 4
1
vote
0 answers
runas or sudo equivalent on AS400 ibm iSeries (invoke it via java code)
Possible Duplicate:
“runas” or “sudo” equivalent on AS400 IBM iSeries
I am trying to invoke a program to run as another user(by getting input user/pwd) in AS400 OS using Java. Like runas in windows or sudo in unix, what can we do in AS400 OS?
I…

AkD
- 161
- 3
1
vote
3 answers
Getting different values of particular variable from a file in UNIX
I have a file which I'd like to parse to extract certain values from it. I don't know what command and syntax I should use (maybe sed?).
Below are 2 sample lines which I might expect to find in the file. What I need is the value of name (i.e 1234…

dhruv
- 11
- 1
1
vote
2 answers
Solaris 8 - directories gone missing; is this housecleaning script the culprit?
Our outsourced IT service provider runs the following script via cron to clean up Oracle core and trace files. It clearly is not a well-written script, but my question for the Serverfault crowd is whether there is an error or boundary condition…

Dave
- 11
- 3
1
vote
2 answers
Is it possible to pass a shell variable from linux to windows via winexe?
I want to pass a shell variable called $test to windows from linux via winexe.
For example:
winexe -W WORKGROUP -U user%password //192.160.13.13 'cmd.exe /C move D:\restore_db\$test D:\Restore\'
Is there any way to do achieve this?

BioLounge
- 115
- 1
- 1
- 6
1
vote
1 answer
Check if drive has enough space before writing
I am looking to make a backup to a remote drive, but I want to do a check prior to doing so.
Is it possible to snatch only the "Available" space from the df output, rather than all of the details, to compare to the size of the dump?

koo
- 23
- 3
1
vote
1 answer
Java command not going to background with &
I'm running a java command:
java weblogic.Admin -adminurl t3://URL:POST -username username -password password START $SERVER &
on an Aix machine.
The problem is that the shell still halts until the command is completed. What should I do to make it…

Vladimir
- 179
- 1
- 1
- 6
1
vote
2 answers
Sending a message to a remote terminal
Is there a way to send a message to a remote terminal similar to using the wall command for other users on the local system? In this scenario I want to specify a username@hostname and have a message appear in their terminal if they are logged in.

Mike
- 11
- 1
- 1
- 2
1
vote
5 answers
Is there any browser utility I can use in SSH for Linux
Is there a text-based browser available for Linux (CentsOS) which I can use when I SSH to my server.
I use CentOS release 5.5. My server do not have graphic interface.
It would be nice if it support JavaScript.

bman
- 219
- 4
- 13
1
vote
3 answers
'cd' switch back and forth to previous and current directory
I found cd - can switch back and forth between previous and current directory which is a very handy feature. Also found cd -- works too, but not sure what exactly that's for. Is there any reference covers this? Please advise, thanks.

Stan
- 1,387
- 6
- 24
- 40
1
vote
2 answers
Unix/Linux command to view available servers
Situation: I'm inspired to work from home this evening. So I download some source from work's svn repo. Unfortunately, I find some lib files are missing. Not a problem, I'll remote in to my desktop at work and check out the environment there and see…

corsiKa
- 383
- 1
- 8
- 19
1
vote
1 answer
how to set the font with mailx?
Solaris Korn Shell
I am writing sql reports to an oracle database, spooling them to a file and emailing them with mailx. I use the syntax below. The reports do not format properly, unless I use the Courier New font. How do I set this with mailx?…

Bob
- 412
- 5
- 9
1
vote
1 answer
How to batch edit a list of files?
I have a list of files where I need to remove some lines that have been added yesterday by a spambot. The section I want to remove looks like this:
^M
That section seems to have been appended to…

Peter Kruithof
- 87
- 1
- 11
1
vote
5 answers
selective backup script in bash
I've been using this simple command (that's all I can do :) to backup the whole tree from my user data in NAS server for a year.
cp -r /STORAGE /BACKUP-STORAGE/YYYY-MM-DD
Unfortunately, after a year of service. My user start filling the spaces with…

Sake
- 417
- 3
- 5
- 12