Questions tagged [unix-shell]

130 questions
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
  • 201
  • 1
  • 3
  • 17
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
  • 741
  • 2
  • 8
  • 17
1
vote
1 answer

How to reliably & portably serialize binary information into POSIX shell

Problem context I am trying to implement a job orchestrator whose agent/worker programs, connect to machines via an SSH session/shell. I would like to transfer (potentially binary) files to these agents (which could be needed for any sort of…
Daniel Gray
  • 147
  • 1
  • 1
  • 5
1
vote
3 answers

Avoid to write clear password in a sh script

I'm writing shell script on my custom board. In this script I use openssl to encode file at runtime using this command: openssl des3 -salt -in file.txt -out my_file.des3 -k my_password Is there a way to avoid to write clear password in a sh…
init
  • 13
  • 3
0
votes
1 answer

While schedule below script through crontab receive incorrect output date format is going wrong

PFB script dd=$(perl -e 'use POSIX;print strftime "%Y%m%d",localtime time-172800;') Date=$(perl -e 'use POSIX;print strftime "%d%m%Y",localtime time-172800;') for i in `cat /path/Path_CDR.txt` do cd $i compress event*$dd*.asn compress…
Bhushan
  • 1
  • 1
0
votes
3 answers

"\" missing in ksh output

I have written a small script as follows #!/usr/bin/ksh cat test |while read line1 do echo "$line1" done The input file "test" has the following lines Kensington K64391US C\i70 Wireless Desktop Nintendo Wii Wireless Nunchuck \M470 DeLonghi…
Ashu
0
votes
0 answers

cron job not working in unix but works when executed manually

I am running a cron job everyday at 21:00 UTC which downloads few csv files from sftp server, renames the downloaded files and then loads the files in database(mysql) and updates the time in database (mysql). ps -ef | grep cron | grep -v grep root …
Roy
  • 1
  • 1
0
votes
2 answers

AWK, cut or ced...double parsing mail log to get authentication failures

I would like to parse mail log files, which originally look like this: 2018-10-23 23:27:51,026 INFO [ImapServer-4] [ip=10.10.11.50;oip=168.232.24.2;via=10.10.11.50(nginx/1.7.1);ua=Zimbra/8.8.7_GA_1964;cid=127325;] imap - authentication failed for…
Labsy
  • 53
  • 1
  • 8
0
votes
2 answers

How to print true if condition in shell script

I'm writing a script to change few setting according to location and to do this i selected hostname as a benchmark. My aim is, if my hostname condition comes true then do this. For this i'm writing a shell script which is comparing few thing in …
root
  • 39
  • 2
  • 8
0
votes
1 answer

getting multiple issues while creating a scrip to update hostnames in /etc/hosts file?

I'm completely new to the scripts and hence need help to fix this. We've around 3000 VMs & 450 Physical servers which are Linux based servers (few of then ubuntu starting from 9.x & few of them are Susu starting 8.X & majority of them are RHEL…
Hrish
  • 87
  • 1
  • 8
0
votes
1 answer

FreeBSD script - different result to manual execution (tcsh)

This question has been asked previously in https://joomla.stackexchange.com/questions/20697/securing-a-joomla-installation-on-apache-mod-php but it may belong here better since it is not Joomla specific. I'm trying to execute a script in tcsh, and…
ExternalUse
  • 165
  • 2
  • 7
0
votes
2 answers

LD_LIBRARY_PATH Configuration Setup Issues

I am facing a weird but a sensible issue, I have 2 ORACLE_HOMEs, 1st one points to ORACLE Database Software and 2nd one points to ORACLE Client Software. Why I am forced to do this - reason is: In my system Pro *c is getting compiled from ORACLE…
0
votes
1 answer

Continuously save tail of standard input

I have a program that generates large logs on the standard output. Actually I don't care about the log, but I do want to know the last 1000 lines or so if the program finishes or crashes. I want something in-between "tail -f" and "> log".. that is…
0
votes
1 answer

How to repeat a command, like a backreference, at the cli?

What I'd like to do is run the same command twice while hitting enter once, with minimum typing. This would be the long version for example: # sudo puppet agent -tv --server foo.bar && sudo puppet agent -tv --server foo.bar I thought about # sudo…
spoovy
  • 354
  • 4
  • 15
0
votes
2 answers

Unix: How to find the name of the ethernet interface through which I'm logged in

We have multihomed servers. And to simplify things, I would like to know the dns of the interface trough which I'm logged in. (e.g. to set PS1 thus it can be used in scp commands) My solution for that problems seems to be rather complicated. => is…
Thomas SV
  • 53
  • 5
1 2 3
8 9