Questions tagged [shell]

A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion. Not only does it allows the user to run programs from a text interface, but frequently offers basic programming features such as variables, substitution, output redirection, and wildcards.

A shell is terminology for a command-line interpreter most commonly used with Unix-like operating systems, but also used to interact with GUI-based operating systems in a more granular fashion.

Not only does it allows the user to run programs from a text interface, but frequently offers basic programming features such as variables, substitution, output redirection, and wildcards.

The name was first used by Unix operating system for an interpreter used for command prompt, but currently the term shell refers to BASH(Bourne Again SHell) and other command prompt interpreters too.

1348 questions
0
votes
1 answer

Command works from bash prompt; does not work from within shell script

I'm trying to use IPMITOOL to query a bunch of OOB NICs to get their MAC addresses. When I run: ipmitool -I lanplus -H 1.2.3.4 -U USER -P PASS lan print I get: MAC Address : aa:bb:cc:dd:ee:ff If I try to call it via a shell script…
Driftpeasant
  • 3,217
  • 2
  • 22
  • 28
0
votes
1 answer

Download with Wget only if new version

Good morning, I have a custom software that updates with a custom script.sh. Part of the file goes something like this: if [[ $software == A ]] then echo "downloading package..." rm -rf test.zip >> SoftwareUpdate.log wget --user admin…
Perovic
  • 21
  • 2
0
votes
0 answers

Copying files from remote, limited to 1k Lines and with compression

I want to fetch files from several remote machines. I want only files that match a specific regex and I want to keep the directory structure. Considerations: The files I want to fetch are plain text log files There are probably many small files and…
0
votes
0 answers

Cannot run bash script via php possible permissions

I have ffmpeg installed on a CentOS 7 machine running a standard LAMP stack. I can run ffmpeg fine by itself in a terminal, like so: ffmpeg -i "rtsp://admin:password@10.0.0.152/play2.sdp" camera1.mp4 I have a php script more or less like the…
Dustin
  • 1
  • 1
0
votes
1 answer

Diff says file does not exists – why?

I transfer a file from a remote server to my local server. If this is done I do a diff to check if both files are identical to check if the transfer was successful. So I do this: ssh -o StrictHostKeyChecking=no -l ${SSH_USER} ${SSH_HOST} "cat…
0
votes
1 answer

Variables (locally defined) not defined when running bash script from cron on MacOS

I have following script for backups creation: #!/usr/bin/env bash { declare -a directories=( "/Applications/Apache" "/Applications/Scripts" ) function duplicateBackups() { from=`realpath $1` to=`realpath $2` echo [ `date…
Radek Suski
  • 103
  • 4
0
votes
1 answer

Linux shell: Pipe stderr and stdout to one file AND to individual files at the same time (using tee?)

I would like to form a pipe-stream that captures stdout to one file and stderr to another file AND both in a third file (so also the complete terminal output is in one file) somehow like this: process ----+-- --- + --- stdlog.txt …
0
votes
0 answers

Updating IP in FreeDNS eg. in 5 seconds instead of an hour via script

Like the title says. At freedns.afraid.org website interface I can set the TTL if I'm premium. But how can I set it to 5s instead of the default 1h using/extending this script: #!/bin/sh #FreeDNS updater…
topkek
  • 1
  • 1
0
votes
1 answer

ping script - host down vs host not on network

I have the following script where I am trying to differentiate between a server that is down and a server that is no longer on the network. If I use the ping command on the command line on a server that is just down and echo the $? I get a 1 as…
0
votes
1 answer

How can I lock down an SSH and/or telnet user to only run a custom shell and no other commands or programs?

I asked this question on stack overflow, but I thought it might be more appropriate here on serverfault, because it has to do with system administration and security. I am looking to prototype a webservice, without having to deal with HTTP and other…
derekmc
  • 3
  • 2
0
votes
0 answers

How to configure PATH in cron, so that it will be set for all crons?

I have a problem where scripts called by cron have very short, safe, path: /usr/bin:/bin I know, that I can: Change scripts to use better path in user crontab add PATH=... configuration But I'd like to be able to tell crond that on this system all…
eijeze
  • 427
  • 1
  • 5
  • 11
0
votes
3 answers

GUI SFTP client that will copy files and folders locally instead of downloading/uploading

I'm looking for a GUI client (preferably Windows) that will recognize when you copy files remotely, and will default to running a local shell command (f.a : sfpt> !rsync -a /files/ /copyoffiles/ in SFTP) Does something like this exist already?
Powertieke
  • 377
  • 2
  • 8
0
votes
1 answer

looking for an alternative to echo to write data to a file so it can be invoked via sudo

Background: when run on a unix box Tenable.io (nessus) will try to create a tag file in /etc/ with a unique string. Presumably so it can identify the machine if the hostname or IP changes. It does this by "sh -c \"echo…
Russell Fulton
  • 201
  • 1
  • 3
  • 17
0
votes
1 answer

php shell_exec returns different results compared to terminal

I try to run shell_exec("ls -l /dev"); to list all entries in /dev and I get this list: total 0 drwxr-xr-x 2 root root 180 Oct 10 11:19 char lrwxrwxrwx 1 root root 11 Oct 10 11:19 core -> /proc/kcore lrwxrwxrwx 1 root root 13 Oct 10 11:19 fd ->…
user2624744
  • 121
  • 2
0
votes
1 answer

Script executes perfectly in command line but failing in cron

I have created a script to know the successful attempts and failed attempts of users,usually everyday the /var/log/secure file goes to syslog and zipped like "secure-20200910.gz" but without extracting the file i want to read the data, for that i…
Naveen
  • 1