The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
1answer
12 views

Can't get PID from backgrounded java job

The PID file for this statement is created but it is always empty. When running the shell with -x I see that $! empty, yet at the end the java job is left running in the background as desired. Why is ...
0
votes
1answer
22 views

remote script execution from local script linux doesn't stop for remote script prompts

script abc.sh is on machine M1 and xyz.sh is on machine M2 script abc.sh: #!/bin/bash ssh -l user1 host.com ./xyz.sh -b1 arg1 -b2 arg2 script xyz has certain user prompts like pwd etc When I ...
1
vote
1answer
26 views

Why is my awk sub command failing?

When I run df -hl | grep '/dev/disk1' | awk '{sub(/%/, \"\");print $5}' I'm getting the following error: awk: syntax error at source line 1 context is {sub(/%/, >>> \ <<< "\...
0
votes
0answers
161 views

Ssh into a remote machine and execute a script using “expect”

I have a script named serverbounce.sh on server A. However, my Hudson home is on a server B. I want to execute my script serverbounce.sh on server A itself.For this performed the following: a. Created ...
0
votes
2answers
64 views

Moving files between hosts using intermediate storage area [closed]

Is there any good existing solution for moving files from host A to host C, using host B a an passive intermediate storage area. A -> B -> C Limitations Host A and host C are on separate networks ...
3
votes
1answer
43 views

Editing the PATH in PASE

I am doing a some PHP development on an IBMi running ZendServer6. I have to call PHP by its full path of /usr/local/zendsvr6/bin/php-cli. Is there a dotfile I can edit in my home directory or some ...
5
votes
1answer
2k views

cp -p will preserve times for some files but not all?

I have a source directory on a machine with a bunch of files, all with the same permissions, that I want to copy to another directory, that is mounted via SMB. [tmark@dexter JR09141045 ...
0
votes
1answer
416 views

Executing command remotely on another linux server from a shell script

I have a shell-script which extract details from a log file between two dates and executes a command on the output to generate some report.The log files are on different server and scripts are ...
1
vote
0answers
305 views

How to package shell script file with license key file

I am working on automated shell script for specific task . Before executing task steps I want to validate the license key provided to the customer with a webservice call. Please help me in making ...
14
votes
5answers
1k views

Copy file permissions, but not files in Unix

(From : http://stackoverflow.com/questions/15245144/copy-file-permissions-but-not-files, closed because off-topic) I have two copies of the same directory tree. They almost have the same files in ...
-2
votes
1answer
39 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
6k 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
835 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 ...
2
votes
1answer
95 views

How to improve the efficiency of gnu parallel to read from a compressed stream?

Is another question extended from the previous one [1] I have a compressed file and stream them to feed into a python program, e.g. bzcat data.bz2 | parallel --no-notice -j16 --pipe python parse.py ...
1
vote
1answer
100 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' localhost:8080/test/api/search?where=where%20%2Fxml%2Fitem%2Fcategory%...
2
votes
3answers
340 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
335 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
104 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
415 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
112 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
68 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 ...
1
vote
1answer
2k 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
180 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
143 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
156 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, `/usr/local/apache-tomcat-6.0.32/...
3
votes
2answers
2k 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
801 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
40 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
897 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
305 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
235 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 ...
1
vote
1answer
3k 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
900 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. ...
1
vote
2answers
569 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
2k 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
853 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
235 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 ...
1
vote
1answer
374 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
452 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
193 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
104 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
7k 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
2k 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
2k 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
714 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
1k 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
131 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 ...
0
votes
4answers
4k 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
857 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
4k 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 ...