Questions tagged [unix-shell]

124 questions
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
  • 169
  • 1
  • 1
  • 5
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
  • 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,367
  • 6
  • 24
  • 40
1
vote
2 answers

How to concatenate environment variable paths in a cleaner way in bash?

In order to modify my paths (like LD_LIBRARY_PATH or PYTHONPATH), I first check is the variable exists. If so, I'm concatenating my old value with the new one (separated with a semicolon), else I'm settings my variable to the new…
Charles
  • 263
  • 1
  • 3
  • 10
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
  • 363
  • 1
  • 6
  • 18
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
1
vote
1 answer

rush config errors: not an absolute directory name

Migrating from rssh to rush... I can't figure out what it means by not an absolute directory name. see logs below: Aug 31 14:07:24 secmgrprd04 systemd: pam_unix(systemd-user:session): session opened for user upload by (uid=0) Aug 31 14:07:24…
Russell Fulton
  • 159
  • 1
  • 2
  • 14
1
vote
1 answer

force unix program output redirect

I'm new to shell-scripting and I guess this should be something quite easy. Anyway I don't know how to force redirect a program's output to the input of another program. I know about the pipe, where you can do program1 | program2 But in my case, I…
phunehehe
  • 731
  • 2
  • 8
  • 17
1 2 3
8 9