add grepper answer manually
// Simply press "a" on your keyboard after searching your question! :)
how to make a grepper answer
Hello here is me making a random grepper answer:
how to add answer to grepper
// how to find out which shell is running.
ps -p $$ – Display your current shell name reliably
echo "$SHELL" – Print the shell for the current user but not necessarily the shell that is running at the movement.
echo $0 – Another reliable and simple method to get the current shell interpreter name on Linux or Unix-like systems.
readlink /proc/$$/exe – Another option to get the current shell name reliably on Linux operating systems.
cat /etc/shells – List pathnames of valid login shells currently installed
grep "^$USER" /etc/passwd – Print the default shell name. The default shell runs when you open a terminal window.
chsh -s /bin/ksh – Change the shell used from /bin/bash (default) to /bin/ksh for your account
grepper add code answer
to connect relationships and display foreign has links. need to identify
*ngIf this.bankAccounts.id == this.company.id similar to Ionic
public function index($id = null)
{
$this->paginate = [
'contain' => ['Organizations','Banks', 'Companies'],
];
$bankAccounts = $this->BankAccounts->find();
if($id){
$bankAccounts->where(['organization_id' => $id]);
$organization = $this->BankAccounts->Organizations->findById($id)->first();
$this->set('organization', $organization);
}
if ($id){
$bankAccounts->where(['company_id' => $id]);
$company = $this->BankAccounts->Companies->findById($id)->first();
$this->set('company', $company);
}
$bankAccounts = $this->paginate($this->BankAccounts);
$this->set(compact('bankAccounts'));
}
public function edit($id = null)
{
$bankAccount = $this->BankAccounts->get($id, [
'contain' => [],
]);
$bankAccount = $this->BankAccounts->find();
if($id){
$bankAccount->where(['organization_id' => $id]);
$organization = $this->BankAccounts->Organizations->findById($id)->first();
$this->set('organization', $organization);
}
if ($id){
$bankAccount->where(['company_id' => $id]);
$company = $this->BankAccounts->Companies->findById($id)->first();
$this->set('company', $company);
}
if ($this->request->is(['patch', 'post', 'put'])) {
$bankAccount = $this->BankAccounts->patchEntity($bankAccount, $this->request->getData());
if ($this->BankAccounts->save($bankAccount)) {
$this->Flash->success(__('The bank account has been saved.'));
return $this->redirect(['action' => 'index']);
}
$this->Flash->error(__('The bank account could not be saved. Please, try again.'));
}
$organizations = $this->BankAccounts->Organizations->find('list', ['limit' => 200]);
$companies = $this->BankAccounts->Companies->find('list', ['limit' => 200]);
$banks = $this->BankAccounts->Banks->find('list', ['limit' => 200]);
$this->set(compact('bankAccount', 'organizations', 'companies', 'banks'));
}