The tag has no wiki summary.

learn more… | top users | synonyms

-2
votes
1answer
21 views

Create symlink if source exists

I'm trying to make a symlink to a directory if it exists only and cannot figure out how. I tried various ideas I found and none worked. Most notable idea that i thought would do the job was to use ln ...
1
vote
2answers
256 views

Kill all currently running cron jobs

For some reason my cron job scripts aren't exiting cleanly and they're backing up my server. There are currently a couple hundred processes running for one of my users. I can use the following command ...
0
votes
1answer
152 views

unable to run the script in linux using plink

I'm unable to run a script in linux using plink.exe. I'm using my user x to login and script is under y user, which I need to sudo to y and run it. I was able to at command prompt manually but not ...
1
vote
1answer
46 views

curl is giving wrong result via ssh

Curl is working fine on the node itself: [ec2-user@smokebase1 ~]$ curl -s -I --retry 3 --header 'Host: smoke-base.dev-test.com' ...
2
votes
3answers
142 views

No shell and launch application on login

I am working on migrating an application from OpenVMS to RedHat Linux 6. The application is a green screen terminal application. The users will log into Linux via SSH and the application should ...
0
votes
1answer
146 views

Fix Solaris 11 GNU tools location for RVM

I am trying to install RVM on a Solaris 11 system, the curl -sSL https://get.rvm.io | bash -s stable went through, but when I actually try to use rvm, it simply stats "ERROR: Missing GNU tools: grep ...
0
votes
2answers
82 views

redirect command executed along with output shell

I would like to redirect the command executed along with the output to a file. for example: #ls >ls_out.txt ls_out.txt should be something like : ls file1 fil2 Thanks!
0
votes
1answer
149 views

Check processor status- check processor/cpu status and failed/off status

I want to Check processor status- check processor/cpu status and failed/off status so for that I used command prtdiag and want to fetch the cpu status only from that. how can i do that?
1
vote
2answers
70 views

Rotatelogs rotating log files mid log entry

I have a c++ tool that outputs to STDOUT via printf i.e. printf ("%s\n", logline); I then pipe that to rotatelogs i.e. tool | rotatelogs /tmp/logs/log_%s 60 Everything works great, but ...
1
vote
1answer
62 views

Sent command-line output as an arguments to other command

1) Here is the command to install special package (for example system/header) #pkg install system/header 2) ALso we can install several packages #pkg install system/header network/ssh package/rpm ...
0
votes
1answer
1k views

How to pipe and echo the result that is being processed? [closed]

I'd like to execute this command: find /apps/ -type f -print0 | grep -z log$ | xargs -0 grep 'this->aForm' And in parallel, I'd like to see which files are being processed. How to to this?
3
votes
2answers
170 views

supress expansion of * in echo

I am working on a script which dynamically executes some queries on daily basis. These queries are coming from a table in the database. Here is the sample output of the query table: ...
0
votes
1answer
86 views

I want to save events or logs grabbed using Inotify to a file

I need your help - using Inotify I am watching a directory for the changes like create, delete, rename and move. I want these event to be logged in a file and I want to run Inotify as a service.
1
vote
1answer
116 views

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, ...
2
votes
2answers
1k views

How can I kill and wait for background processes to finish in a shell script when I Ctrl+C it?

I'm trying to set up a shell script so that it runs background processes, and when I ctrl+C the shell script, it kills the children, then exits. The best that I've managed to come up with is this. It ...
1
vote
1answer
472 views

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 ...
1
vote
0answers
38 views

runas or sudo equivalent on AS400 ibm iSeries (invoke it via java code) [duplicate]

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 ...
2
votes
1answer
503 views

'ls' taking a long time to list 20 subdirectories

I have a directory (my_dir) which has 20 sub directories. Every time I run 'ls' or try to autocomplete a file name in this directory my IO usage goes to 100% and it takes very long time (10 mins) to ...
1
vote
3answers
247 views

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 ...
1
vote
2answers
191 views

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 ...
0
votes
1answer
1k views

How to find a file that contains the specified string in FreeBSD?

I'm searching for the way to find a file that contains specified string text. It should be fast as possible but its not that important. I was reading the manual, and I've build something like that: ...
0
votes
2answers
800 views

How to secure svn+ssh checkout users?

All our SVN repositories are hosted on a dedicated machine on which all the developers have access. Every now and then we need to checkout a repository on a machine we don't own or operate ourselves. ...
0
votes
2answers
389 views

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 ...
2
votes
3answers
1k views

grep - recognize carriage return as new line

I want to search a webserver running unix for php-files containing a specific string. Usually I use these commands to accomplish this: find . -name "*.php" -print0 | xargs -0 grep -H -i "the string ...
0
votes
3answers
362 views

portable unix way to join strings with separator

Is there a portable unix shellscripting way of joining a number of strings together with a given separator, like so: $ strjoin --- foo bar baz quux foo---bar---baz---quux Sure I could use a ...
0
votes
4answers
212 views

Chars referenced by octal values in *NIX shell scripts — getting them to be parsed?

I have a script which absolutely 100% _has_ to be done in this ridiculous fashion: echo $'\150\151\073\145\143\150\157' $'\171\141\171' (unencoded: echo hi;echo yay) The problem is that everything ...
0
votes
1answer
114 views

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 ...
2
votes
3answers
348 views

putty aborts process while shutting down

I'm newby so the question is simple. After I connected to server via putty I want to execute some command. Suppose that command will be performed for long time (e.g. extracting files from large ...
1
vote
1answer
149 views

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 ...
0
votes
1answer
98 views

Shell command to find and file the last modified file in a certain directory

I want to create an alias that displays the latest log in a certain directory - something like: ls -lat *log* | tail -1 | less The above command does not work as the output of the ls -lat command ...
1
vote
5answers
3k views

Counting number of items in a single-row CSV file?

I have a file containing a long comma-delimited list of numbers, like this: 2,8,42,75,101 What's the simplest command (from a Unix shell) to get the count of numbers in this file? In the example ...
0
votes
1answer
839 views

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 ...
0
votes
3answers
711 views

how to find the weblogic server start time in unix box

how to find the weblogic server start time in unix. i have give ps -f | grep port number but it is showing my current system time. how to find this
0
votes
2answers
528 views

What are best practices writing parallel startup scripts in Unix shell (ksh,bash)?

I have a piece of software with different components running on the same Unix machine (web server, DBMS, middleware, different daemons). Startup of the few components depends on the success of the ...
0
votes
4answers
845 views

how to compare the files data in 2 different unix boxes

i have one file which exists in 2 different unix machines. how i can compare the data with in the file
0
votes
3answers
127 views

install mysql on freebsd [closed]

How to install Mysql on freebsd , i have tried a lot but after i am getting lot many error so i have removed it , but now i want to reinstall it so , can anyone suggest me the link / commands to ...
-1
votes
4answers
1k views

Vim how to change the cursor from char block to pre pipe/line [closed]

Not sure what the terminology is for it but on Vim the 'cursor' is always like an insert/replace cursor instead of the blinking line cursor I'm used to in other gui editors. Is there any way to change ...
0
votes
4answers
665 views

direct file transfer via ftp to ftp

Hi i want to transfer few file (which is very big in size ) from A server to B server via ftp. I have credentials of Server A's ftp and Server B's ftp - server B is my own server running unix. so ...
1
vote
5answers
2k views

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 ...
1
vote
3answers
228 views

'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 ...
1
vote
4answers
1k views

Is there an easy way to insert data/time in front of a log file with just shell scripting?

Say I want to monitor memory usage on a java process overnight. I can do something like top | grep java > out.log I will get a log file with a whole bunch of lines. Is there an easy way to get a ...
1
vote
2answers
2k views

How to encode the rdesktop password parameter in a shell script?

I can connect with this script from linux to a windows RDP session: #!/bin/bash /usr/bin/rdesktop -N -x m -u Administrator -p secret123 -d DOMAIN1 127.0.0.1:33891 (The rdp port of the remote ...
0
votes
3answers
183 views

Bash as default shell for Netware user

I am connecting to the Novell Netware (OES) server via ssh. It shows me default novell console. I want it to start bash automatically when I connect. How can I do this?
0
votes
1answer
31 views

Turn off colors in Netware console?

I'm looking for a method of changing colors in default Novell Netware (OES) console
-1
votes
1answer
323 views

Wow, there is no way this is wrong. What is wrong? [closed]

I am going to put this out there first, this is my shell script homework. However, I am finished with my work. It is just not running properly for some reason. I already asked 2 game developer ...
0
votes
2answers
2k views

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 ...
1
vote
1answer
348 views

Picking a single line from a text file by its line number

In a Unix shell, how can I pick a single line from a text file by its line number? Say I want whatever is at line 3 in animals.txt to be written to stdout (bat bat bat). monkey monkey monkey cat cat ...
2
votes
3answers
120 views

Will uploading modified version of a KSH script affect processes that are currently running the script?

Let say I have a KSH script my_script.ksh that performs complex operations including but not limited to invoking SQLPLUS to manipulate large number (millions) of records in an Oracle database. The ...
7
votes
4answers
7k views

Append an echo to file?

In linux, how do I do something like echo 'hello world' > log.txt but instead of overwriting the contents of log.txt, it appends to the end of of log.txt?
4
votes
2answers
734 views

How do I prevent bash $ substitution?

I'm trying to preserve $if below and would like the following to output $if bash is getting in the way by doing $ substitution $ sed -e 's:\\$:\\$:g' <<ENDOFFILE > $if > ...