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

Using multiple users in crontab script, silently fails when changing users

I'm trying to run a bash script on a centos server. I've running the script as the root user (both for file permissions), but I also need to use the aws service permissions that belong to a service account. We have decided not to give the root…
RunThor
  • 197
  • 2
  • 12
0
votes
0 answers

non interactive shell locale

I'm running commands on a remote host via ssh where i'd like to have locale vars set. I do not care about the full profile scripts from a true interactive shell, just the locale vars. The minimum test is to have ssh remotehost locale to output…
gcb
  • 344
  • 1
  • 4
  • 18
0
votes
2 answers

uptime | awk -F: '{print $NF}' - What happens here?

Can someone explain me what happens here? uptime | awk -F: '{print $NF}' -F: field separator $NF: number of fields in the current line I don't understand why this command result in the same result as uptime | awk -F: '{print $5}'
Mike
  • 103
  • 1
  • 5
0
votes
1 answer

Occasional permission denied when getting logs using gcloud through Jenkins running as GKE

We are using a Jenkins project to run "gcloud logging read ..." from a shell to get logs from a gcloud container and we occasionally see a permission error in the script: ERROR: (gcloud.logging.read) PERMISSION_DENIED: Request had insufficient…
0
votes
2 answers

cronjob every 4 weeks, not executing

I am using cron on my Ubuntu headless server 18.04 and the following cron is not executing: 30 13 * * 6 test $((10#$(date +%W)%4)) -eq 1 && /bin/bash /backup/test.sh I tested the command in shell: test $((10#$(date +%W)%4)) -eq 1 && /bin/bash…
beard black
  • 67
  • 2
  • 14
0
votes
1 answer

LDAP Linux import user shell config files

I want to know if it's possible to import some user config files (shell config for zsh or bashrc for example) from our LDAP when a user login for the first time ? It's exactly what mak /etc/skel but it's not defined per user so they can't have their…
Navino16
  • 1
  • 3
0
votes
2 answers

Extract string from column with grep

I have a column based .txt file and I want to grep output the Common Name, having a little trouble. V 300223164711Z 01 unknown /C=UK/O=LMG/OU=server/CN=server/name=server/emailAddress=support@kam.org V 300223170002Z 02 unknown…
Kam-ALIEN
  • 19
  • 5
0
votes
2 answers

Echo command, need substitution

i write a backup log script and have 2 variable in echo, but still doesn't work. My command : echo " DB-Size $(du -hs /backup/db/db_$(date +%F).sql " >> /backup/backup.log In my echo statement, i have command variable, in the command…
beard black
  • 67
  • 2
  • 14
0
votes
2 answers

Ubuntu-Server bash colors not appearing on login

I am running Ubuntu Server 8.04 (hardy), and when I login remotely i can't see the colors when using ls, however after I type "bash" into the shell I see colors, I've already checked my .bashrc and all the colors are enabled by default…
BassKozz
  • 645
  • 2
  • 8
  • 15
-1
votes
2 answers

Trying to execute this shell script but getting this error

Trying to execute this shell script. #!/bin/bash # Proper header for a Bash script. # Cleanup, version 2 # Run as root, of course. # Insert code here to print error message and exit if not root. LOG_DIR=/var/log # Variables are better than…
truthtriumphs
  • 59
  • 1
  • 10
-1
votes
1 answer

How to pass variable into bash script and use seperate variables with awk?

I have a script that I am using to clear out all lines of a log files older than X days. X can be passed in via command line as well as the log file name, ex usage: ./purge-catalina.sh 3 /opt/tomcat8/logs/catalina.out The script itself looks like…
ninjasense
  • 141
  • 1
  • 6
-1
votes
1 answer

No such file or directory linux shell script

#!/bin/bash mysql -uroot -pwelcome1 < /home/sai/first.sql echo "The program has completed" I am trying to call a sql file from shell script ,I am running the script as bash run.sh, but it telling that there is no such directoryfirst.sql, but if i…
-1
votes
1 answer

Checking if a programm is running on linux

i'm trying to check if a program on a linux server is running and start it if not. But i get strange errors: #!/bin/sh SERVICE=nrpe ps -ef | grep -v grep | grep $SERVICE | wc -l if [ $? -gt 1 ] then echo "$?" echo "$SERVICE service…
Kjellson
  • 85
  • 6
-1
votes
2 answers

getting suspicious file alert emails from root

i am getting these emails from root i have been getting emails from root with suspicious file alert with this messages File: /tmp/installd/perl588installer/CPAN-SQLite-0.196/t/01basic.t Reason: Script, starts with #! Owner: : Action: No action…
John
-1
votes
1 answer

Did someone just run intentionally db.dropDatabase() on my mongo shell? Can you access mongo remotely and bypass ssh password?

To my surprise, my database was empty after not looking at it for a week. There were collections and a few rows of data. It's running on a digital ocean 14.04 Ubuntu droplet. Mongod is running on the default port, no password or bind ip (I have…