Programming in an Interpreted language executed by a running Shell

learn more… | top users | synonyms

0
votes
0answers
30 views

SSH issues: keyfile and host file not working as expected

When I login to server with a key ssh -i /home/me/.ssh/id_rsa server everything goes without glitch. The key is authorized on the server. However if I try to do same from a shell script, I get a ...
-2
votes
0answers
24 views

Linux have a script download a file on your computer [on hold]

I am setting up a special kind of script for a project that I am working on. I'd like my script, when executed, to take a file that is on the server and put it on the computer. I have no idea how I ...
-2
votes
2answers
49 views

How to insert text from a file into another in bash [closed]

The content in fileA is: Here’s the ip list. ip: 2.2.3.4 ip: 2.2.3.5 ip: 2.2.3.6 ip: 2.2.3.7 The content is fileB is ip: 1.2.3.4 ip: 1.2.3.5 ip: 1.2.3.6 ip: 1.2.3.7 How to use sed command or ...
0
votes
1answer
32 views

Executing local function code on a remote server

I am updating about 20 bash scripts that perform various server-side operational tasks, checking status / sending reports etc. On some environments these scripts will run locally, on others they need ...
0
votes
0answers
7 views

find running ec2 instances and compare with tag like “linux” running instances or get mail whose running without tag. vai shell script

with help of code: Array3=ec2-describe-instances | grep INSTANCE | grep running | awk '{print $2,$5,$9,$10}' Array2=ec2-describe-tags --filter "resource-type=instance" --filter "key=linux" | awk ...
1
vote
0answers
57 views

Powershell-Script is not exectued correctly

I have a power-shell-script which is called by a batch-file. The batch calls the script after it has set the execution policy to unrestricted. Currently the script does nothing more than writing a ...
1
vote
1answer
39 views

Mysql optimize one table in all databases

I see in the mysqlcheck manual that there's an option for --tables that overrides that databases option, but it isn't well explained. I'm trying to run mysqlcheck -o and I want it to optimize a ...
-1
votes
1answer
122 views

Bash Script - Expect does not send password that ends with $!. Also need improvement to report connection timed out

Update: Password issue is fixed and connection timed out message was fixed too. Adding \ before $! worked. Example: *password\$! set passwds { *password\$! @tempP@ss %Test4%} For connection timed ...
3
votes
3answers
56 views

How to pass command output as several arguments to another command

I have a command that produce a output like this: $./command1 word1 word2 word3 I want to pass this three words as arguments to another command like this: $ command2 word1 word2 word3 How to pass ...
1
vote
1answer
66 views

Operator \> and \< (string version comparison) are not recognised in shell script

I am trying to run Casandra nodetool and getting warnings coming from .sh script. [root@d11ca4cc-fa95-c8a9-e133-e64c434f0e6f ~]# nodetool status /opt/local/share/cassandra/bin/nodetool[53]: .[97]: ...
0
votes
2answers
56 views

While loop does not return control

The following shell script works only for first server and does not loop to the next. I tried 0< before the ssh command but it still does not return to the shell script once connected. #!/bin/sh ...
0
votes
1answer
57 views

Cronjob for a bash script pauses for 2 minutes randomly

I have been running a bash script on CEntOS 5.5 machine that checks replication on a remote mysql server. The script creates a temporary lock file and is scheduled to run in Crontab every minute. But ...
0
votes
3answers
84 views

how to run the dialog command with proccess

Please look on my code – ( bash script ) I want to display both dialogs on the screen on the same time, one dialog display the: tail –f from - /var/log/proccess1.log , and the second dialog ...
0
votes
0answers
59 views

Bash and background processes PGID and receiving signals

My actual problem is that a process I run in an rcfile in docker as docker run container bash --rcfile rcfile remains attached to the bash session by sharing the PGID which means that when I Ctrl-C an ...
1
vote
2answers
156 views

Which open source program is similar to the Linux “dialog” command? [closed]

The linux dialog command is a great tool for creating dialog boxes in terminal windows (e.g. in a bash script). However, there is a drawback of dialog which is that the window is always positioned in ...
3
votes
1answer
106 views

How to view two dialog boxes on the linux console, running on the same time?

I want to view on the Linux console two dialog windows on the same time. I want a window that views the progress BAR, and the a second tailbox that view the logs are running. The problem is that the ...
0
votes
2answers
153 views

Bash: Execute command from variable without eval

I have a problem with a script which should execute a curl command composed from the given arguments. It works if I use eval in the subshell, however, I would like to avoid that as it seems to be bad ...
-1
votes
2answers
225 views

Read mail from Postfix using shell script [closed]

I would like to be able to read incoming mail from a Postfix MTA using a shell script. The shell script should be able to retrieve the mail headers, subject, body, attachments, etc., then mark the ...
0
votes
1answer
150 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
votes
2answers
109 views

Delete all files except the newest of each day

I have dump directory that is filled at the rate of one file per 4 hours. I wish to keep all files for a week then delete all except the newest of each day. Bash is preferred though other solution ...
-2
votes
1answer
61 views

how to write a script to get ifInOctets and ifOutOctets? [closed]

Can any one help me with writing a script to get ifInOctets and ifOutOctets from a server 10.38.2.24 ? I need help
0
votes
1answer
68 views

Bash function hangs while command run perfectly without function

Following function hangs : ssh() { local RESULTS; RESULTS=$(ssh $USERNAME@$SERVER $SSH_COMMAND1); echo $RESULTS; } ssh; while if i run following commands they work fine : ...
0
votes
1answer
463 views

Passing variables in kickstart

I have a kickstart file that takes a hostname in the %pre section. I cannot seem to figure out how to get it two the first. As you see it sends the server information to another device which then ...
0
votes
1answer
362 views

ways to automatically fix line endings in shell scripts or files who break with ^M

Problem We regularly break our files lines endings and things stop working without us noticing. Bash complains about "invalid option" or ": command not found" as described here: ...
3
votes
3answers
576 views

Year Month day from file name in shell script

I hava file names like below adn_DF9D_20140515_0001.log adn_DF9D_20140515_0002.log adn_DF9D_20140515_0003.log adn_DF9D_20140515_0004.log adn_DF9D_20140515_0005.log adn_DF9D_20140515_0006.log ...
1
vote
1answer
189 views

Replacing LineFeed \x0a with SED

I have to delete lots of Linefeeds (Hex \x0a) in a logfile. I just have sed to solve the problem. It is a bit complicated I know.. Do you have idea how to solve the problem? Here is an example ...
0
votes
2answers
259 views

Moving files using sftp

I am trying to move files from one location to another on the remote server using sftp below: for i in a b c d do sftp $REMUSR <<EOM>>$OUT 2>&1 rename ...
0
votes
3answers
177 views

Bash script: compare paths issue

I'm working on the bash script that iterates over the list of files. I need to compare the paths to this files with the array containing the restricted paths. Inside the for loop I get a path to a ...
2
votes
1answer
38 views

Inspecting how $PATH gets created

Is it possible to "listen" to a variable's value during the start of a new shell? I have a script that checks for the $PATH variable in the typical places, but I'd like to try something different. ...
-2
votes
1answer
35 views

Ubuntu shell: Get tomorrow's weekday [closed]

I have a shell script for backups and I need the Weekday of tomorrow. $Today = $(date +%a) #$Tomorrow = ?
0
votes
3answers
360 views

Exclude with the find command [duplicate]

I need some help getting the find command to work right in a script working on. I need to be able to exclude some directories. Below I have what I'm doing as a work around. sudo find / ( -name ...
4
votes
1answer
436 views

Shell script: the child process do not terminate in linux

I have written a shell script to initiate three background process in the same time. In shell script I am trying to wait for all children to finish their job and then the parent job to terminate. But, ...
2
votes
1answer
543 views

Terminate remote process when backgrounded ssh session is terminated

So right now I have a bash script that runs a command on a remote machine using ssh. The machine running the bash script is a Linux machine and the remote machine is a Windows machine running cygwin. ...
1
vote
3answers
4k views

Cannot get Exchange PowerShell script to run under Scheduled Tasks

I have a PowerShell script that works when entered directly into the PowerShell. The PowerShell program is run with the shorcut: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ...
0
votes
2answers
402 views

Script for search string inside the file for every one hour

I need to write a script where the particular string(alphanumeric) should be searched inside the file with every hour for whole day. And the search should not contain the previous hour results. Time ...
2
votes
3answers
1k views

power shell error: Cannot bind parameter

when i am trying to execute the below PowerShell command, i got error . The command : *PS cert:\currentuser\authroot> gci | where subject -like "UTN"* The error is below : Where-Object : Cannot ...
0
votes
1answer
93 views

How do I write a script that compares folder/symbolic-link names from two diffrent folders?

I need help in writing a script to create symbolic links. Here is a script that I have been running on background. #!/bin/bash SOURCE="/home/$USER/www" DEST="/var/www" while true; do find $SOURCE ...
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!
-1
votes
2answers
162 views

Run a script on ssh login

I have a development env. with 4 users, I want to be able to log their time logged in since they are contractor working from home. I have NO idea how to do it, my sys admin left me this weekend and I ...
1
vote
1answer
104 views

Wrangling sed to find and reformat login date (or, how to kill idle mosh-server processes)

I have an old method of killing idle mosh-server processes, which doesn't work on my new VPS. Here's the old method, which I run in root's crontab to clean up mosh processes that have been idle for ...
0
votes
3answers
1k views

Global Redirection of port 80 to 443

I'd like to setup my linux box so that anything hitting port 80 would simply be told ask that of 443. I want it to be regardless of domain, IP or whatever specific details may exist. If it can be ...
0
votes
1answer
659 views

find directories in the current directory, older than 5 days and archive them

This is basic questions. I need to find folders in the current working directory(not recursively) and if they are older than 5 days archive them. zip or tar.gz is fine. I can find the folders with ...
1
vote
3answers
553 views

How to start Rails from a shell script on Debian?

I don't really have any need to mess with passenger or capistrano at the moment. I simply want to run rails on boot on port 3000. I've attempted to replicate this tutorial for node as much as I could ...
0
votes
2answers
68 views

Script to change MySQL password from command line

I host some websites for people with a simple server. I can't afford nifty things like cpanel, and I don't want to waste memory on a giant blob of perl like webmin. I am wondering if anyone has come ...
1
vote
3answers
1k views

Running ssh-agent from a shell script

I'm trying to create a shell script that, among other things, starts up ssh-agent and adds a private key to the agent. Example: #!/bin/bash # ... ssh-agent $SHELL ssh-add /path/to/key # ... The ...
0
votes
1answer
215 views

using unison options in shell script?

I'm new to unison, and am trying to use its options in a simple shell script, but they seem to be ignored when the script is executed, causing no changes to be synced between the two servers. My ...
1
vote
2answers
797 views

How can I make ssh wait until the command exits? [closed]

I have a script that looks like this: SERVER="RHT372 RHTl373 RHT374 RHTl375" case $1 in "stop") for SERVER in $SERVER do echo "================================================" echo ...
0
votes
1answer
301 views

Providing network drive access to a windows service

I have a windows service, which requires access to a network drive. As Windows Service does not perform interactive logon, it's not possible to use mapped drive from active directory user logon ...
0
votes
1answer
93 views

Parsing access.log squid proxy

I have logs files, access.log-*, and I need exclude the 'TCP-DENY' (or include only the 'TCP-MISS'). How I parsing, like grep command on linux, access.log file on windows? On linux it is work fine. ...
1
vote
0answers
107 views

error in killing tshark from shell script

I'm getting this error "* glibc detected * /usr/sbin/tshark: double free or corruption " while doing this, any idea why? #!/bin/bash trap 'my_exit; exit' SIGINT SIGQUIT count=0 /usr/sbin/tshark -i ...